In this post, I will tell you how to replace characters with a special character in PHP. In a rare scenario, we need to hide particular information from original for security purposes.

For example, when we made any transaction bank will send SMS with your first and last few digits for account numbers with Debit amount details.

Another example, whenever we lost or forget the profile login credential then we get or change the particular details with the help of registered e-mail or phone no. In that time the system will ask you to type exact details what you provided at the time of registration. In that area, the system will show your details with some special character as a note.
Here we are using str_repeat() and substr() methods to perform the task.

 

Leave a Reply

Your email address will not be published. Required fields are marked *