3v4l.org

run code in 300+ PHP versions simultaneously
<?php $reader = array(array ( 0 => 'Phone', 1 => 'Sum', 2 => 'Name', 3 => 'Something else', ), array ( 0 => '+1 555123456', 1 => 50.00, 2 => 'Johnny Doe', 3 => 100.50 ), array ( 0 => '911', 1 => 20.12, 2 => 'Eli the Computer Guy', 3 => 99.99 )); $row = 1; // header row $new_array = array(); foreach ($reader as $data) { if ($row == 1) { $headers = $data; } else { $new_array[] = array_combine($headers, $data); } $row++; } print_r($new_array);
Output for git.master_jit, git.master, rfc.property-hooks
Array ( [0] => Array ( [Phone] => +1 555123456 [Sum] => 50 [Name] => Johnny Doe [Something else] => 100.5 ) [1] => Array ( [Phone] => 911 [Sum] => 20.12 [Name] => Eli the Computer Guy [Something else] => 99.99 ) )

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:
115.62 ms | 406 KiB | 5 Q