note 15590 added to ref.strings
| From: | flagzen at libero dot it | Date: | Fri, 21 Sep 2001 19:52:21 +0000 |
| Subject: | note 15590 added to ref.strings | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-18151@lists.php.net to get a copy of this message | ||
while we're waiting that ctype functions get out from experimental phase, look at this
function.
It check if a string contain only alphanumeric characters (a-zA-Z0-9)
function isalphanumstr($string) {
for($i = 0; $i < strlen($string); $i++)
if
(!in_array($string[$i],array("q","w","e","r","t","y","u","i","o","p","l","k","j","h",
"g","f","d","s","a","z","x","c","v","b","n","m","Q","W",
"E","R","T","Y","U","I","O","P","L","K","J","H","G","F",
"D","S","A","Z","X","C","V","B","N","M","0","1","2","3",
"4","5","6","7","8","9");
return false;
return true;
}
http://www.php.net/manual/it/ref.strings.php