Replace and print characters retrieved from Mysql

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Tas Man
Forum Newbie
Posts: 1
Joined: Tue Aug 29, 2006 12:26 pm

Replace and print characters retrieved from Mysql

Post by Tas Man »

I have a php script that retrieves usernames from my mysql DB and displays that info on a page.
What I would like to do is replace the first 3 charaters of that username and replace it with 3 special charcters. I want to do this for security reasons. Does anyone have any code that would do this for me.
Thanks in advance.

Tas Man
blackbeard
Forum Contributor
Posts: 123
Joined: Thu Aug 03, 2006 6:20 pm

Post by blackbeard »

Code: Select all

substr_replace($origString, $newSubString, $startindex, $numCharactersToReplace);
Post Reply