RE: [PHP-GENERAL] Using eregi to validate a name.
| From: | Jaroslav Kazmir | Date: | Sun, 11 Jun 2000 22:42:58 +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-1572@lists.php.net to get a copy of this message | ||
On Sun, 11 Jun 2000, Richard Heyes wrote:
> > I´m using eregi to validate a input, from a input form, where
> > the users
> > types
> > their name, eg. René Müller.
> >
> > What i need is a string patter that allows the user to use
> > all 'normal'
> > characters like a-z ä é and so on, but not #_: and other special
> > characters.
>
> Try this:
>
> $string = strtr($string, '_:;<>,./', '########');
> $string = str_replace('#', '', $string);
*********************************
ALL this special chars you could replace by this class :
$string = Ereg_replace ("([[:punct:]])","", $string);
>
> --
> Richard Heyes
> http://www.heyes-computing.net/scripts/
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>