note 33388 added to function.ereg
| From: | christo at gacse dot com | Date: | Tue, 24 Jun 2003 18:41:16 +0000 |
| Subject: | note 33388 added to function.ereg | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-50951@lists.php.net to get a copy of this message | ||
I just use one of the example that someone put above and as I'm a newbie guy, I was trying to
find out a way to validate a password, and alphanumeric field wich have only alphanumeric chars, and
not spaces, I tried too many things before I get to this.
$var_to_validate = "123--45";
If (ereg('^([a-zA-Z0-9@*#]{8,15})$', $var_to_validate))
{
echo "Valid var";
}
else
{
echo "Not valid var";
}
?>
I post this 'cause this is what I was lookin for when I just came here, so I hope this can help
to anyone.
----
Manual Page -- http://www.php.net/manual/en/function.ereg.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33388
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33388&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33388&report=yes