[snip] That would have been my first choice also, however, with the # and - being legal, things like ctype_alnum and others don't work out. [/snip]
Here is an example of something that I did before; $alphachar = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; $ld1alpha = strspn($ld1, $alphachar); if(strlen($ld1) != $ld1alpha){ $err[$i] = "The LD1 may only contain alpha characters.<br>\n"; $i++; } int strspn ( string str1, string str2) - Returns the length of the initial segment of str1 which consists entirely of characters in str2. You could add - and # to $alphachar Now, in this case $ld1aplpha would be the same length as the string length of the input field where the characters are contained in $alphachar. This is used as one of the steps in a verification/validation procedure on a large internal form. Just another solution to the problem HTH! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php