note 39810 modified in function.ctype-alnum by vrana
| From: | vrana@php.net | Date: | Tue, 17 Aug 2004 14:56:02 +0000 |
| Subject: | note 39810 modified in function.ctype-alnum by vrana | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-79773@lists.php.net to get a copy of this message | ||
I think "thehiddenfire" wanted to say is that "ctype_alnum" would be like this:
<?php
function ctype_alnum($text) {
for ($i = 0; $i<strlen($text); $i++) {
if (!ctype_alpha($text[$i]) && !ctype_digit($text[$i]))
return false;
}
return true;
}
?>
Note that I've changed the "if" condition to "&&".
--was--
I think "thehiddenfire" wanted to say is that "ctype_alnum" would be like this:
function ctype_alnum($text) {
for ($i = 0; $i<strlen($text); $i++) {
if (!ctype_alpha($text[$i]) && !ctype_digit($text[$i]))
return false;
}
return true;
}
Note that I've changed the "if" condition to "&&".
http://php.net/manual/en/function.ctype-alnum.php