/ Published in: PHP
Nice little function will star out a password for simple reminder -
Original Password: password41!
New: ******d41!
Enter number of letters to show at end with $number_show
Original Password: password41!
New: ******d41!
Enter number of letters to show at end with $number_show
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function star_out_password($password,$number_show){ $star = ''; $star = str_repeat('*',(strlen($password) -$number_show)) . substr($password,-$number_show,$number_show); } return $star; } /* TRY IT OUT */ $reminder = star_out_password('m$ypaSs423',4); // returns *******s423