Try this: if (is_numeric($txt1) && (float)$txt1<24 && (strlen($txt1)-strpos($txt1,"."))<=3) { echo "True"; } else { echo "False"; };
Misha PHP Genie "Electroteque" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > is_numeric and strlen ? > > -----Original Message----- > From: Shaun [mailto:[EMAIL PROTECTED] > Sent: Tuesday, June 03, 2003 7:21 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Validating user input > > > Hi, > > I am creating a timesheet application, how can I make sure that a user has > entered a number, and that the number is a whole number or a decimal up to 2 > places, and that the number is less than 24? > > Thanks for your help > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php