I need a solution to replace whole string with stars in PHP, for example there are strings like:
And depends on string length, it will replace string with the stars like:
test has 4 characters in length so it will be replaced with 4 stars
test123 has 7 characters in length so it will be replaced with 7 stars
*******. Y así...
Is there any good solution for that?
preguntado el 03 de mayo de 12 a las 20:05
$string = str_repeat('*', strlen($string));
Simply make a new string, consisting of all stars, with length equal to the original.