What will be the output of the following script?
$result = ''; function glue ($val) { global $result; $result .= $val; } $array = array ('a', 'b', 'c', 'd'); array_walk ($array, 'glue'); echo $result;
The array_walk function executes a given callback function for every element of an array. Therefore, this script will cause the glue function to concatenate all the elements of the array and output abcd.