Question: What will be the output of the following script?<?php
$result = '';
function glue ($val){
global $result;
$result .= $val;
}
$array = array ('a', 'b', 'c', 'd');
array_walk ($array, 'glue');
echo $result;
?>
A
B
C
D
E
abcd
B
glue
C
Array
D
abcdabcd
E
none
Note: 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.