<?php
$array = Array
(
"0" => Array
(
"0" => "Name",
"1" => "Company",
"2" => "Email",
"3" => "City",
),
"1" => Array
(
"0" => "Foo",
"1" => "Foo & co",
"2" => "foo@mail.com",
"3" => "NY",
),
"2" => Array
(
"0" => "Bar",
"1" => "Bar & co",
"2" => "bar@mail.com",
"3" => "Las Vegas",
)
);
$final_result = array();
foreach($array as $key=>$value){
if($key == 0){
$final_result = array_values($value);
}else{
$result[]= array_combine($final_result, array_values($value));
}
}
echo "<pre>";
print_r($result);
?>
preferences:
26.39 ms | 406 KiB | 5 Q