note 110720 deleted from function.ctype-alnum by danbrown

From: Date: Thu, 06 Dec 2012 14:13:06 +0000
Subject: note 110720 deleted from function.ctype-alnum by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-192302@lists.php.net to get a copy of this message
Note Submitter: support at freeelancers dot net ---- Well, me too.. When I have to allow some more values in it, I use them in same way, and i create function for it.. $str = ""; function validate_username($str) { $allowed = array(".", "-", "_", "@", " "); // you can add here more value, you want to allow. if(ctype_alnum(str_replace($allowed, '', $str ))) { return $str; } else { $str = "Invalid Username"; return $str; } }

« previous php.notes (#192302) next »