3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str='ID=62981155;IT=OV80419674-62981155_1_3;OD=15.4;|ID=62981157;IT=OV80419674-62981157_1_3;OD=3.1;|ID=62981159;IT=OV80419674-62981159_1_3;OD=8.13;|'; preg_match_all("/(.*?)\=(.*?);/", $str, $match); //var_dump($match); $i = 0; foreach($match[1] as $key => $m){ if($m[0] == "|"){ $i++; $u[$i][substr($m,1)] = $match[2][$key]; }else{ $u[$i][$m] = $match[2][$key]; } } echo json_encode($u);
Output for git.master, git.master_jit, rfc.property-hooks
[{"ID":"62981155","IT":"OV80419674-62981155_1_3","OD":"15.4"},{"ID":"62981157","IT":"OV80419674-62981157_1_3","OD":"3.1"},{"ID":"62981159","IT":"OV80419674-62981159_1_3","OD":"8.13"}]

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:
117.99 ms | 405 KiB | 5 Q