note 108922 added to function.strspn
| From: | bob at example dot com | Date: | Tue, 05 Jun 2012 15:37:33 +0000 |
| Subject: | note 108922 added to function.strspn | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-188407@lists.php.net to get a copy of this message | ||
Quick way to check if a string consists entirely of characters within the mask is to compare strspn
with strlen eg:
$path = $_SERVER['PATH_INFO'];
if (strspn($path,'/') == strlen($path)) {
//PATH_INFO is empty
}
----
Server IP: 69.147.83.197
Probable Submitter: 24.89.139.58
----
Manual Page -- http://www.php.net/manual/en/function.strspn.php
Edit -- https://master.php.net/note/edit/108922
Del: integrated -- https://master.php.net/note/delete/108922/integrated
Del: useless -- https://master.php.net/note/delete/108922/useless
Del: bad code -- https://master.php.net/note/delete/108922/bad+code
Del: spam -- https://master.php.net/note/delete/108922/spam
Del: non-english -- https://master.php.net/note/delete/108922/non-english
Del: in docs -- https://master.php.net/note/delete/108922/in+docs
Del: other reasons-- https://master.php.net/note/delete/108922
Reject -- https://master.php.net/note/reject/108922
Search -- https://master.php.net/manage/user-notes.php