RE: [PHP] Extracting Numbers from a string.

2002-09-12 Thread Adam Williams
e"; > $mynumber=$mystring+1-1; > > $mynumber now equals 56.55 If you want the . to go to, use the other > methods. > > -Original Message- > From: Jason Caldwell [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, September 11, 2002 3:31 PM > To: [EMAIL PROTECTED] >

RE: [PHP] Extracting Numbers from a string.

2002-09-12 Thread David Buerer
ED]] Sent: Wednesday, September 11, 2002 3:31 PM To: [EMAIL PROTECTED] Subject: [PHP] Extracting Numbers from a string. I need to extract the numbers only from a field. For example: I have an AMOUNT field and so that I can filter out any user typo's I would like to extract the numbers only.

Re: [PHP] Extracting Numbers from a string.

2002-09-11 Thread Zak Greant
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On September 11, 2002 16:31, Jason Caldwell wrote: > I need to extract the numbers only from a field. > > For example: I have an AMOUNT field and so that I can filter out any user > typo's I would like to extract the numbers only. > > If the user ent

Re: [PHP] Extracting Numbers from a string.

2002-09-11 Thread Dan Ostrowski
A simple: eregi_replace("[^0-9]", "", $myvar); should do it. it says.. replace everything that is not a number ( character class "[^0-9]" which means Character class "[" NOT "^" of Decimal "0-9" end character class "]" ) with a NULL string, thereby ripping out all non-numeric components and l

[PHP] Extracting Numbers from a string.

2002-09-11 Thread Jason Caldwell
I need to extract the numbers only from a field. For example: I have an AMOUNT field and so that I can filter out any user typo's I would like to extract the numbers only. If the user enters $56.55 for example or just $56 then I would like to be able to remove the "$" and the "." keeping just t