这是我的php数组:
$array['title'] = array(0 => 'John', 1 => 'Wick');
$array['price'] = array(0 => '100$', 1 => '200$');
$array['count'] = array(0 => 88900, 1 => 92000);
我想像这样转换它:
$result[0] = array('title' => 'John', 'price' => '100$', 'count' => 88900);
$result[1] = array('title' => 'Wick', 'price' => '200$', 'count' => 92000);
我会做一个大数据。如何最有效的解决方案?
答案 0 :(得分:0)
也许有一种原生方式可以做到这一点,但这有效: 这是最有效的方法吗?我会让你对它进行基准测试。
> Array (
> [0] => Array
> (
> [title] => John
> [price] => 100$
> [count] => 88900
> )
>
> [1] => Array
> (
> [title] => Wick
> [price] => 200$
> [count] => 92000
> )
>
> )
{{1}}