Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
$arr = array(3=>'test',6=>'test 2');
我想成功
$arr = array(0=>'test',1=>'test 2');
什么是最好的方法 。是否有任何 php 函数可以做到这一点。
提前致谢
只需使用array_values:
array_values
$arr = array(3=>'test',6=>'test 2'); $arr = array_values($arr);
http://www.php.net/manual/en/function.array-values.php