2
我有这样的代码Insert键和值到数组
$array = array('o' => 'one', 't' => 'three', 'f' => 'four');
array_push($array, array('s' => 'six'));
print_r($array);
是插入新的键和值到阵列,但是当我打印新$阵列,它返回这个
Array ([o] => one [t] => three [f] => four [0] => Array ([s] => six))
我需要像这样返回
Array ([o] => one [t] => three [f] => four [s] => six)
如何从数组中删除[0] => Array()
?
'$ array ['s'] ='six''? – andrewsi