RE: Newbie ! How do I find if a string contains a number?

From: Date: Mon, 28 Aug 2000 15:42:27 +0000
Subject: RE: Newbie ! How do I find if a string contains a number?
Groups: php.db 
Request: Send a blank email to php-db+get-2420@lists.php.net to get a copy of this message
Read about the ereg() and related functions in the documentation. You probably want something like... if (ereg("[0-9]", $your_variable)) { //if $your_var contains a #
    // do somethingn to it
    }
else {
    // do something else
    }
------- Peter Wrote:
I am checking a string to see if it contains a number so I know which >type of data I have.
So abf33 is Type A, advv is Type B, which tells me which field to >query.
Can't find a function to do this test.
_________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. Share information about yourself, create your own public profile at http://profiles.msn.com.

« previous php.db (#2420) next »