PHParray_reduce()Function ❮ PHP Array Reference ExampleGet your own PHP Server Send the values in an array to a user-defined function and return a string: <?php functionmyfunction($v1,$v2) { return$v1 ."-". $v2; } $a=array("Dog","Cat","Horse"); ...
A function to be run for each element in the array. Reducer function parameters: totalRequired. TheinitialValue, or the previously returned value of the function. currentValueRequired. The value of the current element. currentIndexOptional.