我有一个数组:
array('something' => 'like this', 'something' => 'like this', 'something' => 'like this');
我想把它替换成这样(尽可能快,使用一个简单的内联函数):
array(0 => 'like this', 1 => 'like this', 2 => 'like this');
可以使用任何内置的 php 数组函数吗?
最佳答案
查看 array_values
$new_array=array_values($array);
print_r($new_array);
关于php - 用数字键替换关联数组键的最快方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6384761/