note 76303 added to function.ctype-alnum
| From: | rajeshwar316 at gmail dot com | Date: | Mon, 09 Jul 2007 23:55:37 +0000 |
| Subject: | note 76303 added to function.ctype-alnum | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-128349@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.20
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/76303
Del: integrated -- https://master.php.net/note/delete/76303/integrated
Del: useless -- https://master.php.net/note/delete/76303/useless
Del: bad code -- https://master.php.net/note/delete/76303/bad+code
Del: spam -- https://master.php.net/note/delete/76303/spam
Del: non-english -- https://master.php.net/note/delete/76303/non-english
Del: in docs -- https://master.php.net/note/delete/76303/in+docs
Del: other reasons-- https://master.php.net/note/delete/76303
Reject -- https://master.php.net/note/reject/76303
Search -- https://master.php.net/manage/user-notes.php