3v4l.org

run code in 300+ PHP versions simultaneously
<?php $db = 'id|name_sname|identity|address|region|hours|destination|price; -------------------------------------------------------------------- 1|Ezra Mod|123456789|husi, stanilesti, vaslui|HUSI - IASI|20:00|HUSI|100; 2|Ezra Mod|123456789|husi, stanilesti, vaslui|HUSI - IASI|20:00|HUSI|100; 3|Ezra Mod|123456789|husi, stanilesti, vaslui|HUSI - IASI|20:00|HUSI|100; 4|Ezra Mod|123456789|husi, stanilesti, vaslui|HUSI - IASI|20:00|HUSI|100; 5|Ezra Mod|123456789|husi, stanilesti, vaslui|HUSI - IASI|20:00|HUSI|100; 6|Ezra Mod|123456789|husi, stanilesti, vaslui|HUSI - IASI|20:00|HUSI|100;'; $lines = explode(PHP_EOL, $db); foreach($lines as $key => $line){ $convert = explode("|", $line); //create array separate by new line if($key == 0) { foreach($convert as $column_name) { $columns[] = $column_name; } } if(is_numeric($convert[0])) { $data[$columns[0]][] = $convert[0]; } } print_r($data);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [id] => Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 [5] => 6 ) )

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:
38.33 ms | 401 KiB | 8 Q