RE: [PHP] just looking for some opinions...

From: Date: Thu, 24 Jul 2003 17:43:42 +0000
Subject: RE: [PHP] just looking for some opinions...
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-156698@lists.php.net to get a copy of this message
Thanks John, You and 4 others (3 private direct replies) all gave me the same suggestion. I have no idea why I never think to use a regex... Appreciate the thought! -Dan Joseph > -----Original Message----- > From: CPT John W. Holmes [mailto:holmes072000@charter.net] > Sent: Thursday, July 24, 2003 1:44 PM > To: Dan Joseph; php-general@lists.php.net > Subject: Re: [PHP] just looking for some opinions... > > > > Let's say I have a number: 12800001924 > > > > The rules call for removing "1280+", meaning remove 128 and all 0's that > > come after it, until you run into another number. > > > > In the end, it would leave 1924, and everything else on the beginning > would > > be gone. > > $new_number = preg_replace('/^1280+/','',$number); > > ---John Holmes... >

« previous php.general (#156698) next »