Re: check for special characters...

From: Date: Fri, 26 Mar 2004 16:44:38 +0000
Subject: Re: check for special characters...
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-181564@lists.php.net to get a copy of this message
Chris Mach wrote:
How would I check if a variable has special characters in it like !@#$%^ etc ? and give an error if it contains one of them.
if(preg_match('/[^a-z0-9]/i',$value)) { echo "special characters present!"; } -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com

« previous php.general (#181564) next »