Re: Strip Numbers
| From: | Jeff Harris | Date: | Wed, 30 Jul 2003 07:13:29 +0000 |
| Subject: | Re: Strip Numbers | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-157495@lists.php.net to get a copy of this message | ||
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... is there an easy way to do that????
|
|Joe Harman
|
|http://www.HarmanMedia.com
|
Since a problem should be stated in its basic and simplest terms, it
appears that you want to simply divide the
number by 10000 and take the integer portion:
$number=floor($passed/10000);
Jeff
--
Registered Linux user #304026.
"lynx -source http://jharris.rallycentral.us/jharris.asc |
gpg --import"
Key fingerprint = 52FC 20BD 025A 8C13 5FC6 68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.