<?php function repl0($m) { return '&#'.$m[0]; } $s = 'This is a good 23200; sample ship'; echo "input1= ".htmlentities($s)."<br>"; $out1=preg_replace_callback('/(?<!#)(\d{4,5};)/','repl0',$s); echo 'output1 = '.htmlentities($out1).'<br>';
You have javascript disabled. You will not be able to edit any code.