Bunu yapmak için *, nasıl bir dize 4~8 karakterleri ile değiştirmek istiyor?
*
4~8
HelloWorld => Hell****ld
kullanmak
substr_replace()
gibi
substr_replace($string, '****', 4 , 4);
Daha fazla okuyun:
http://php.net/manual/en/function.substr-replace.php
$string = 'HelloWorld'; for ($i = 4; $i <= 8; ++$i) { $string[$i] = '*'; }
Ama bunu yapmak için pek çok yol daha var.
Kullanmak gerekir substr_replace().
$str = substr_replace("HelloWorld","****",3,-2);