开发者

How to displays keys of an array?

开发者 https://www.devze.com 2023-03-14 00:44 出处:网络
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:

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

精彩评论

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