i have dynamic number of arrays and i need to make them a multidimensional array
Array ( [id] => 182 [name] => item1 )
Array ( [id] => 185 [name] => item2 )
Array ( [id] => 186 [name] => item3 )
to this
$all = Array ( Array ( [0] => Array ( [id] => 182 [name] => item1 ) ,
Array ( [1] => Array ( [id] => 185 [name] => item2 ) ,
Array ( [2] => Array ( [id] => 186 [name] => item3 )
)
i tries this code but it's not working
$all_ids = Array ( [0] => 182 [1] => 185 [2] => 186 );
foreach($all_id as $id){
// use code to return row
$row= 'select id , name from table where id ='.$id; // something like this which return row
$all= $all+ $row ;
}
any help please , thanks in advance