php - CakePHP shift and reindex associative array -


i have problem. maybe simple solve.

there array looking this:

(int) 0 => array(     (int) 0 => array(         'post' => array(             'name' => 'value'         )     ) ), (int) 1 => array(     (int) 0 => array(         'post' => array(             'name' => 'value'         )     ),     (int) 1 => array(         'post' => array(             'name' => 'value'         )     ) ) 

that needs this:

(int) 0 => array(         'post' => array(             'name' => 'value'         )     ) (int) 1 => array(         'post' => array(             'name' => 'value'         )     ) (int) 2 => array(         'post' => array(             'name' => 'value'         )     ) 

i tried array_shift() , directly after that, array_values(), gave me first post.

i assume order "0, 0, 1", php cut after first one.

$array = call_user_func_array('array_merge', $array); 

Comments

Popular posts from this blog

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -