note 78348 deleted from function.ctype-alnum by felipe

From: Date: Mon, 10 Dec 2007 23:00:24 +0000
Subject: note 78348 deleted from function.ctype-alnum by felipe
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-133338@lists.php.net to get a copy of this message
Note Submitter: mvanberkel at gmail dot com ---- Although in an empty string "every character is either a letter or a digit", ctype_alnum('') will return bool(false)! Please try at home :-) For now, I use: if($input !== '' && !ctype_alnum($input)) throw new Exception('Invalid input'); Somebody better suggestions? (except preg_match)

« previous php.notes (#133338) next »