Re: [PHP] Strip Numbers

2003-07-30 Thread Jeff Harris
On Jul 30, 2003, "Joe Harman" claimed that: |Hey could someone help me out here | |I need to strip numbers from a passed variable | |ex. 3899007 | |all the numbers will have 990 (so that is the 4th, 5th & sixth |numbers... from the right...) I want to keep everything to the left of |the two 9s

RE: [PHP] Strip Numbers

2003-07-29 Thread Martin Towell
You could use two substr()s or an ereg_replace() $result = substr($str, 0, 2) . substr($str, 5); or $result = ereg_replace("([0-9][0-9])990([0-9][0-9])", "\\1\\2", $str); Both are not tested, but should work Martin -Original Message- From: Joe Harman [mailto:[EMAIL PROT