Check if a variable is a number or a numeric string. This is much the same as (is_numeric) but will only return true for any number of digits with no decimal part and optional exponential part what so ever.
Quote
isnum ( mixed $value )
<?php
$value = "abc123";
if (isnum($value)) {
echo "This is a number of digits!";
} else {
echo "This is not a number of digits!";
}
?>
Quote
This is not a number of digits!
<?php
$value = "123";
if (isnum($value)) {
echo "This is a number of digits!";
} else {
echo "This is not a number of digits!";
}
?>
Quote
This is a number of digits!
<?php
$value = "123.456";
if (isnum($value)) {
echo "This is a number of digits!";
} else {
echo "This is not a number of digits!";
}
?>
Quote
This is not a number of digits!