note 35850 added to function.strspn
| From: | kari_hre at hotmail dot com | Date: | Tue, 16 Sep 2003 23:57:53 +0000 |
| Subject: | note 35850 added to function.strspn | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-56593@lists.php.net to get a copy of this message | ||
As to the comment below, much wiser is to use regular expressions for matching string to some
allowed characters,
<?php
if (preg_match('#^[A-Za-z]*$#', $str))
echo 'No invalid Chars contained';
else
echo 'ERROR: contains invalid chars!';
?>
will do the same as below.
----
Manual Page -- http://www.php.net/manual/en/function.strspn.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+35850
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+35850&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+35850&report=yes