Depending on how you define the numerical value, you will use one of the following functions:
With the first, numerical is defined as (quoting):
Numeric strings consist of optional digits, any number of digits, optional decimal part and optional exponential part.
So far, with the second, you will be (citing):
Checks if all characters in if string, text, numeric
And, for the alphabet, you will be interested in:
Quote:
Checks if all characters in text, text, are alphabets. In standard C characters, just [A-Za-z]
And, as @Long Ears noted in his comment, if you want to check both in the same frame, you will find ctype_alnum() (quoting):
Checks if all characters in a string, text, alphanumeric.
In any case, you can take a look at the full list of Ctype features .
source share