Re: ereg problem
| From: | Newman Weekly. | Date: | Sat, 13 Mar 2004 01:47:36 +0000 |
| Subject: | Re: ereg problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-180307@lists.php.net to get a copy of this message | ||
Don't worry about this I worked out that the example was wrong (o;
----- Original Message -----
From: "Newman Weekly." <Weekly@PhilipNZ.com>
To: <php-general@lists.php.net>
Sent: Saturday, March 13, 2004 1:59 PM
Subject: [PHP] ereg problem
<?php
$formUserName="foobar";
if (ereg("^[a-bA-B][a-bA-B0-9]{3,11}$",$formUserName)
{
// IS VALID.
$pageUserNameValid="YES";
}
else
{
// NOT VALID
$pageUserNameValid="NO";
}
// PAGE OUT PUT..
echo $pageUserNameValid;
?>
This simple script is ment to check to a user nae field but I have done something wrong.
$pageUserNameValid This should be yes for foo bar.
// Phil