foreach.php

<?php
$arr = 'GIF','JPG','PNG','SWF','PSD'];
// foreach ($arr as $value){
//     $temp[] = strtolower($value);
// }
// print_r($temp);
$arr = array_map('strtolower',$arr);
print_r($array);
// 1 internal operations can traverse the array automatic
2 // Data type of the second parameter is an array, the array will in turn pass the value to the first parameter

// callback function: it refers to the function name as a parameter to another function appears

Guess you like

Origin www.cnblogs.com/lujieting/p/12466151.html
Recommended