Jump to content

Aleirita

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Aleirita's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. so... for those of you out there looking for the validating code for time .. HERE IT IS!! Ale.
  2. Thanks that DID work! I just added the mins > 59 .. function validTime($time) { $bits = explode(':', $time); if (($bits[0] > 24) || ($bits[1] > 59) || ($bits[0] == 24 && $bits[1] > 0) || count($bits) > 2) { echo " $time is invalid!"; return 0; } else { echo " $time is valid!"; return 1; } } THANKS!!! Ale.
  3. oooppssss yes my bad i meant 14:15 .. but anyway what you gave me didnt work either.... it validates 25:10 and 12:68 as ok! .... Ale.
  4. as the subject says.. I need to validate TIME input in a form by the user (military hour)... I use checkdate() for the date thats input but I cant find a solution to validate the time.. "24:15" --> RIGHT!!! "32:58" --> WRONG!!! Please help ! Ale.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.