以取代数字键关联数组键快捷的方式 [英] Quickest way to replace associative array keys with numerical keys
本文介绍了以取代数字键关联数组键快捷的方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个数组:
array('something' => 'like this', 'something' => 'like this', 'something' => 'like this');
我想取代它(尽快,用一个简单的内联函数)是这样的:
I would like to replace it (quickly as possible, using a simple inline function) to be like this:
array(0 => 'like this', 1 => 'like this', 2 => 'like this');
可以使用任何内置的PHP阵列功能?
Possible using any built-in php-array functions?
推荐答案
$new_array=array_values($array);
print_r($new_array);
这篇关于以取代数字键关联数组键快捷的方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文