Determine whether the size of the number is within a certain range. If you only determine whether it is a number, there is no need to use it.
# Determine the size of the number. To determine the size of the number, you can use the is_numeric($str)
provided by the system.
#------------------------------------------------ ----------
Function isNumber ($fNum, $fMin="", $fMax="") {
if ( eregi("^[0-9] $", $fNum) ) {
if ( "" == $fMax && "" == $fMin ) {
Return True;
} elseif ( "" == $fMin && $fNum <= $fMax ) {
Return True;
} elseif ( "" == $fMax && $fNum >= $fMin ) {
Return True;
} elseif ( $fNum >= $fMin && $fNum <= $fMax ) {
Return True;
} else {
Return False;
}
} else {
Return False;
}
}