note 57691 deleted from function.strspn by nlopess
| From: | nlopess@php.net | Date: | Tue, 11 Oct 2005 17:28:50 +0000 |
| Subject: | note 57691 deleted from function.strspn by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-96845@lists.php.net to get a copy of this message | ||
Note Submitter: info at masta-code dot de
----
just a suggestion
<?php
function valid($string, $length = 10) {
if(strlen($string) <= $length && preg_match('/^[a-z0-9_\-]+$/i', $string))
return true;
return false;
}
?>