开发者

How to rearrange the array element from 0th index in the sequence to end?

开发者 https://www.devze.com 2023-01-03 15:24 出处:网络
How to rearrange the array element from 0th index in the sequence to end in PHP? UPDATED I have an array:

How to rearrange the array element from 0th index in the sequence to end in PHP?

UPDATED

I have an array:

$input =array{ 
                              2 => '13234390',
                              4 => '12345290',
                              5 => '21322210' 
                              }

now I want this array to be rearranged as

$input =array{ 
                              0 => '13234390',
                              1 => '12345290',
                              2 => '213222开发者_运维技巧10' 
                              }


With

  • array_values() returns all the values from the input array and indexes numerically the array.

Example:

$array = array_values($input);
0

精彩评论

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