I want to replace with the 4~8 characters of a string with *,how to do it?
4~8
*
HelloWorld => Hell****ld
use
substr_replace()
like
substr_replace($string, '****', 4 , 4);
read more :
http://php.net/manual/en/function.substr-replace.php
2.1m questions
2.1m answers
60 comments
57.0k users