3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = '123ABC5678'; $User_input = "2.3-2-2.1"; preg_match_all("/(.)/", $User_input, $pattern); $i=0; $str=""; foreach($pattern[1] as $val){ if(is_numeric($val)){ $str .= substr($string,$i,$val); $i=$i+$val; }else{ $str .= $val; //$i=$i+1; } } echo $str;
Output for git.master, git.master_jit, rfc.property-hooks
12.3AB-C5-67.8

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