The function is_numeric() will check if the input is a integer or a string containing integers.
// Return: 0 (False)
echo (int)is_numeric(array());
// Return: 1 (True)
echo (int)is_numeric(551);
// Return: 1
echo (int)is_numeric(55.85);
// Return: 1
echo (int)is_numeric('6854');
// Return: 0
echo (int)is_numeric('542letters571');
// Return: 1
echo (int)is_numeric(58+36);
The result
0
1
1
1
0
1
1
1
1
0
1
Mail this!
- Comments (0)
- PingBacks (0)
- TrackBacks (0)

» Latest comments