尽管这工作得很好,但我很好奇是否有人知道这样做的更漂亮的方法,因为这种情况似乎经常出现。
<?php
//Initialy, data is nested up in $some_array[0] ...
$some_array = array(array('somevar' => "someValue", "someOtherVar" => "someOtherValue"));
print_r($some_array);
数组([0] => 数组([somevar] => someValue [someOtherVar] => someOtherValue))
// Could the following line be achieved a more elegant fashion?
$some_array = $some_array[0];
print_r($some_array);
// Prints the intended result:
数组( [somevar] => someValue [someOtherVar] => someOtherValue )
有谁知道用本机功能或更优雅的方式实现这一目标的方法?
谢谢!