Hi I am trying to check if a word contains only capital letters. For some reason it's not working. The below example is checking the word "weird" to see if it's all capital letters but it's saying it's matches. I've tried checking for only lower case letters with "WEIRD" and it's not working there too. What am I doing wrong?
$pattern = "A-Z"; $regexp = '/^['.$pattern.']*$/i'; if( preg_match($regexp, "weird") ) echo "matches"; else echo "does not match"; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php