RE: [PHP-GENERAL] Using eregi to validate a name.
| From: | Richard Heyes | Date: | Sun, 11 Jun 2000 22:50:28 +0000 |
| Subject: | RE: [PHP-GENERAL] Using eregi to validate a name. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-1573@lists.php.net to get a copy of this message | ||
> > $string = strtr($string, '_:;<>,./', '########');
> > $string = str_replace('#', '', $string);
> *********************************
> ALL this special chars you could replace by this class :
> $string = Ereg_replace ("([[:punct:]])","", $string);
Maybe, but regexs are slow.
--
Richard Heyes
http://www.heyes-computing.net/scripts/