1ctype_digit(string text);
2
3Parameter Used:
4The ctype_digit() function in PHP accepts only one parameter.
5
6text : Its mandatory parameter which specifies the tested string.
7
8Return Values:
9It returns TRUE if all characters of the string are numeric otherwise
10 return FALSE.
11
12Input : '789495001'
13Output : TRUE
14Explanation : All digits, return True
15
16Input : 'adc123' or '789.0877'
17Output : FALSE
18Explanation: String contains number and string or floating point,
19return false.
1is_numeric ( $var )
2 returns : true or false
3
4'42' is numeric
51337 is numeric
61337 is numeric
71337 is numeric
81337 is numeric
91337.0 is numeric
10'0x539' is NOT numeric
11'02471' is numeric
12'0b10100111001' is NOT numeric
13'1337e0' is numeric
14'not numeric' is NOT numeric
15array (
16) is NOT numeric
179.1 is numeric
18NULL is NOT numeric
19