3v4l.org

run code in 300+ PHP versions simultaneously
<?php $oldstr1='<span style="font-family: Times New Roman; font-size: 12pt;">'; $oldstr2='</span>'; $newstr1='<input type="radio" value="1" name="choice">'; $newstr2="</input>"; $str='<span style="font-family: Times New Roman; font-size: 12pt;"></span>'; while (preg_match($oldstr1, $str) && preg_match($oldstr2, $str)) { $str = preg_replace($oldstr1,$newstr1, $str, 1); $str = preg_replace($oldstr2,$newstr2, $str, 1); } echo $str;

preferences:
40.68 ms | 402 KiB | 5 Q