tags:

views:

49

answers:

2

i have this array:

[2] => Array
    (
        [type] => jpg
        [name] => 25.jpg
    )

[3] => Array
    (
        [type] => jpg
        [name] => 26.jpg
    )

[8] => Array
    (
        [type] => jpg
        [name] => 27.jpg
    )

[13] => Array
    (
        [type] => jpg
        [name] => 10.jpg
    )

[14] => Array
    (
        [type] => jpg
        [name] => 11.jpg
    )

how i can change back the id to 0,1,2,3... etc? instead of 2,3,8,13,14?

+8  A: 

Try array_values.

kevingessner
+3  A: 

Assuming they're still well-ordered, and assuming your array is named $input:

$result = array_values($input);

Should work.

Jonathan Grynspan
it works. thanks
greenbandit