Convert Multidimensional array to single array

i want to convert multidimensional array to single array

I am having this array

array (
0 => array ( 'sno' => 'q3', 'result' => '15', ),
1 => array ( 'sno' => 'q1', 'result' => '5', ),
2 => array ( 'sno' => 'q2', 'result' => '10', ),
)

i want this resulting array


array ( 'q3' => '15', 'q1' => '5','q2' =>'10' )

i tried foreach, but it gives the values (not an array ) like q3 15 q1 5 q2 10

Try:


$newArray = array();
foreach($multi as $array) {
 foreach($array as $k=>$v) {
  $newArray[$k] = $v;
 }
}

This loops through your multidimensional array and stores the results in the new array variable $newArray.