3v4l.org

run code in 300+ PHP versions simultaneously
<?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); ?>
Output for git.master, git.master_jit, rfc.property-hooks
<pre>Array ( [0] => Array ( [Name] => Foo [Company] => Foo & co [Email] => foo@mail.com [City] => NY ) [1] => Array ( [Name] => Bar [Company] => Bar & co [Email] => bar@mail.com [City] => Las Vegas ) )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
14.54 ms | 406 KiB | 5 Q