replacing part of string

Any questions involving matching text strings to patterns - the pattern is called a "regular expression."

Moderator: General Moderators

Post Reply
SuperFly
Forum Newbie
Posts: 19
Joined: Thu Nov 10, 2005 9:47 am
Contact:

replacing part of string

Post by SuperFly »

Hi everyone, I need some help:
I have a string looks like this:
Hello there this is my number 123456
and I would like it to be like this:
Hello there this is my number 123xxx
Just first 3 numbers are visible and the rest of it is replaced with xxx

does anyone have an idea how to do this? or where can i wint some tutorial

Regards
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post by CoderGoblin »

I would suggest you look at regular expressions especially preg_replace.
Post Reply