重新排列数组键php

时间:2012-01-10 02:03:32

标签: php arrays sorting

我有这个数组:

Array
(
[15] =>     13.1

[16] =>     Mark one answer

[19] => You see a car on the hard shoulder of a motorway with a HELP pennant displayed. This means the driver is most likely to be

[20] => a disabled person first aid trained

[21] => a foreign visitor

[22] => a rescue patrol person

[25] => DES s15, HC r278);

如何从0对键进行排序? 得到这个:我知道有一个功能,但我的头被烧了,排序功能不适合我的需要,因为他们重新排列值,我需要它们保存。

 Array
(
[0] =>  13.1

[1] =>  Mark one answer

[2] => You see a car on the hard shoulder of a motorway with a HELP pennant displayed. This means the driver is most likely to be

[3] => a disabled person first aid trained

[4] => a foreign visitor

[5] => a rescue patrol person

[6] => DES s15, HC r278);

1 个答案:

答案 0 :(得分:32)

我认为你正在寻找array_values

$arr = array_values($arr);