开发者

How to displays keys of an array?

I have an array looking so:

Array
(
 [0] => a
 [1] => b
 [3] => c
 [4] => d
 [15] => e
)

and i want to get something like that:

开发者_如何学PythonArray
(
 [0] => a
 [1] => b
 [2] => c
 [3] => d
 [4] => e
)

How do I get the intended effect?


array_values($array)

Easy as pie :)


$new_array = array_values($old_array); //this will return sorted  one
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜