Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

PHP : quick preg_match function question

  • 14-12-2005 01:47AM
    #1
    Registered Users, Registered Users 2 Posts: 3,514 ✭✭✭


    Hi lads. At the moment i have the preg_match function blocking users from signing up with first names such as ££%^£^ in my script. How would i modify this code
    [PHP]function check_first_name($first_name){
    if(!preg_match("/[^a-zA-Z0-9\.\-\ß\ä\Ä\ü\Ü\ö\Ö\ ]+$/s",$first_name)) return TRUE;
    else return FALSE;
    }[/PHP]

    to prevent users from signing up with the name 353£"£%^£
    Thanks


Advertisement