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' -

Making Empty C++ Project: General exception (Exception from HRESULT:0x80131500) Visual Studio Community 2015 -

How to fix java warning for "The value of the local variable is not used " -