Example analysis of array_work usage in PHP, array_work instance Analysis
The example in this paper describes array_work usage in PHP. Share to everyone for your reference. Specific as follows:
The test array $array = array ( ' php ', ' arrays ', ' is ', ' cool ' ),//Some variable for testing: $some _var = ' NEW '; The function that get ' s called for each entryfunction format_array_values (& $item, $key, $some _var) { $item = $s Ome_var. ": $item (KEY: $key)
";} "Walk" trough each array item and call the function://"Format_array_values" Array_walk ($array, ' format_array_values ', $ Some_var);//Print the Result:print_r ($array);/*the output would be:array ( [0] = new:php (key:0)
[1] = New:arrays (key:1)
[2] = New:are (key:2)
[3] = New:cool (key:3)
)*/
I hope this article is helpful to everyone's PHP programming.
http://www.bkjia.com/PHPjc/1031487.html www.bkjia.com true http://www.bkjia.com/PHPjc/1031487.html techarticle PHP array_work Usage Example Analysis, array_work example Analysis of the example of the Array_work usage in PHP. Share to everyone for your reference. as follows://The test array $array ...