note 76302 added to function.ctype-alnum
| From: | raj at osu1 dot php dot net | Date: | Mon, 09 Jul 2007 23:54:36 +0000 |
| Subject: | note 76302 added to function.ctype-alnum | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-128348@lists.php.net to get a copy of this message | ||
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";
}
}
----
Server IP: 203.16.234.19
Probable Submitter: 58.175.60.158
----
Manual Page -- http://www.php.net/manual/en/function.ctype-alnum.php
Edit -- https://master.php.net/note/edit/76302
Del: integrated -- https://master.php.net/note/delete/76302/integrated
Del: useless -- https://master.php.net/note/delete/76302/useless
Del: bad code -- https://master.php.net/note/delete/76302/bad+code
Del: spam -- https://master.php.net/note/delete/76302/spam
Del: non-english -- https://master.php.net/note/delete/76302/non-english
Del: in docs -- https://master.php.net/note/delete/76302/in+docs
Del: other reasons-- https://master.php.net/note/delete/76302
Reject -- https://master.php.net/note/reject/76302
Search -- https://master.php.net/manage/user-notes.php