note 76302 deleted from function.ctype-alnum by felipe
| From: | felipe@php.net | Date: | Mon, 10 Dec 2007 23:00:33 +0000 |
| Subject: | note 76302 deleted from function.ctype-alnum by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-133339@lists.php.net to get a copy of this message | ||
Note Submitter: raj
----
When checking strings with multiple words for non alphanumeric characters ctype_alnum would consider
space as non alphanumeric character as well.
So to check a string with multiple words for non alphanumeric characters use str_replace
foreach ($imported_queries as $check_aplhanum) {
$check_aplhanum = str_replace (" ", "", $check_aplhanum);
if (!(ctype_alnum($check_aplhanum))) {
echo "Query string contains alphanumeric characters";
}
}