Re: Checking for Valid Charactors.
| From: | Jason Wong | Date: | Sun, 08 Jun 2003 08:57:22 +0000 |
| Subject: | Re: Checking for Valid Charactors. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-150657@lists.php.net to get a copy of this message | ||
On Sunday 08 June 2003 16:22, Philip J. Newman wrote:
> I would liek to check for 0-9 and . charactors i'm using ...
>
> $email = "60.00";
>
> if eregi("^[0-9.])?$",$email) {
>
> echo"valid";
>
> } else {
>
> echo"not valid";
>
> }
>
> Its not working well. umm ... help ...
eregi("^([0-9.])*$", $string)
will match:
an empty string
a string containing only 0-9 and periods
It is better for you to learn the preg_*() functions instead of the ereg*()
ones.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
This fortune is false.
*/