简单教程
提交运行
代码编辑器:
<?php function myfunction($v1,$v2) { return $v1 . "-" . $v2; } $a=array("Dog","Cat","Horse"); print_r(array_reduce($a,"myfunction",5));
运行结果: