It is possible to use the dedicated function, ctype_alnum to check whether it is an alphanumeric value or not. Post navigation How can we check the value of a given variable is a number? How do I check if a given variable is empty?