Re: [PHP] Reg Exp help needed

2003-06-24 Thread Don Read
On 24-Jun-2003 Sparky Kopetzky wrote: > I'm translating (hacking) code from Perl to PHP and have two reg exp > expressions I can't figure out what they do. > > 1st: $goodbadnum =~ tr/0-9//cd; I think this one removes any chars that > are not numbers. > Nope. That removes digits '0-9' $goodbadnu

[PHP] Reg Exp help needed

2003-06-24 Thread Sparky Kopetzky
I'm translating (hacking) code from Perl to PHP and have two reg exp expressions I can't figure out what they do. 1st: $goodbadnum =~ tr/0-9//cd; I think this one removes any chars that are not numbers. 2nd: $goodbadnum =~ tr/0-9/x/; I think this one replaces and numbers with an 'x'. Right, wr