I want to replace with the 4~8 characters of a string with *,how to do it?
4~8
*
HelloWorld => Hell****ld
$str="HelloWorld"; print preg_replace("/^(....)....(.*)/","\\1****\\2",$str);