validating input

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I want to check a string for only numbers and letters but am banging
my head with regex:

$good = "joh_'";

// Let's check the good e-mail
if (preg_match("/[a-z0-9]/", $good)) {
        echo "Good";
} else {
        echo "Bad";
}

This returns Good, why?

Thanks!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux