Re: regular exp if help
| From: | callen | Date: | Wed, 23 Aug 2000 20:43:46 +0000 |
| Subject: | Re: regular exp if help | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-13216@lists.php.net to get a copy of this message | ||
Chris Murley wrote:
>
> Hi all, i have a string containing my name
>
> $string = "chris";
>
> I want to check $string to see if contains any characters other that
> 0-9a-zA-Z and if it does, exit.
$string="+++";
if ( !ereg( "([a-zA-Z0-9])" , $string) )
{
do_some_exit_code();
}
else {
echo "Was a satandard alpha etc";
}
--
Christopher C.M. Allen
http://design.driver8.org/
Email: callen@driver8.org
Cell : 1.715.821.4006
Home Phone: 1.715.426.6661