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

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -