简单教程
提交运行
代码编辑器:
<?php function myfunction($v1,$v2) { if ( $v1 === $v2 ) { return "same"; } return "different"; } $a1=array("Horse","Dog","Cat"); $a2=array("Cow","Dog","Rat"); print_r(array_map("myfunction",$a1,$a2));
运行结果: