I need to check in PHP if user entered a decimal number (US way, with decimal point: X.XXX)
Any reliable way to do this?
A total cludge.. but hey it works !
$numpart = explode(".", $sumnum); if ((exists($numpart[1]) && ($numpart[1] > 0 )){ // it's a decimal that is greater than zero } else { // its not a decimal, or the decimal is zero }