今天我学习了array_map()PHP的一个特例,在文档中作为旁注提到:
Example#4创建一个数组数组
Run Code Online (Sandbox Code Playgroud)<?php $a = array(1, 2, 3, 4, 5); $b = array("one", "two", "three", "four", "five"); $c = array("uno", "dos", "tres", "cuatro", "cinco"); $d = array_map(null, $a, $b, $c); print_r($d); ?>上面的例子将输出:
Run Code Online (Sandbox Code Playgroud)Array ( [0] => Array ( [0] => 1 [1] => one [2] => uno ) [1] => Array ( [0] => 2 [1] => two [2] => dos ) [2] => Array ( [0] => 3 [1] => three [2] => tres ) [3] …