I don\'t want preg_match_all ... because the form field only allows for numbers and letters... just wondering what the right syntax is...
Nothing fancy ... just need to
If you just want to ensure a string contains only alphanumeric characters. A-Z, a-z, 0-9 you don't need to use regular expressions.
Use ctype_alnum()
Example from the documentation:
The above example will output:
The string AbCd1zyZ9 consists of all letters or digits.
The string foo!#$bar does not consist of all letters or digits.