3v4l.org

run code in 300+ PHP versions simultaneously
<?php $long_string = '"name" => "Able","company" => "Tesla","haircolor" => "brown","name" => "Aaaa","home" => "Kansas","shoe" => 12<>"name" => "Bob","company" => "Target","haircolor" => "red","name" => "Bbbb","home" =>"Ohio","shoe" => 11.5'; function multiexplode ($delimiters,$string) { $ary = explode($delimiters[0],$string); array_shift($delimiters); if($delimiters != NULL) { foreach($ary as $key => $val) { $ary[$key] = multiexplode($delimiters, $val); } } return $ary; } // Example of use // $string = "1-2-3|4-5|6:7-8-9-0|1,2:3-4|5"; // $delimiters = Array(",",":","|","-"); $delimiters = Array("<>",","); $res = multiexplode($delimiters,$long_string); echo '<pre>'; print_r($res); echo '</pre>';
Output for git.master, git.master_jit, rfc.property-hooks
<pre>Array ( [0] => Array ( [0] => "name" => "Able" [1] => "company" => "Tesla" [2] => "haircolor" => "brown" [3] => "name" => "Aaaa" [4] => "home" => "Kansas" [5] => "shoe" => 12 ) [1] => Array ( [0] => "name" => "Bob" [1] => "company" => "Target" [2] => "haircolor" => "red" [3] => "name" => "Bbbb" [4] => "home" =>"Ohio" [5] => "shoe" => 11.5 ) ) </pre>

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:
77.89 ms | 402 KiB | 8 Q