note 76303 deleted from function.ctype-alnum by nlopess
| From: | nlopess@php.net | Date: | Fri, 13 Jul 2007 19:23:27 +0000 |
| Subject: | note 76303 deleted from function.ctype-alnum by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-128485@lists.php.net to get a copy of this message | ||
Note Submitter: rajeshwar316 at gmail dot com
----
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";
}
}