ctype_digit and ctype_alnum
ctype_digit(string text)
This function is used to check whether the argument is decimal, If the every character in the argument is digit it will return TRUE otherwise it will return false.
Example:
$num = “1234″;
echo ctype_digit($num);
$num = “1234asd”;
echo ctype_digit($num);
In the above code first echo prints 1, because num contains only digits. The second echo will prints nothing, because num contains some letters also.
ctype_alnum ( string text)
This fucntion is used to chcek whether the argument contains alpha numeric characters only. It will return TRUE if the every character in the argument is either digit or letter. Otherwise it returns nothing.
Example:
$num = “1234asd”;
echo ctype_alnum($num);
Above will print 1, because $num contains digits and letters only.
