FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Verifying time in php
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Verifying time in php [message #179386 is a reply to message #179385] Sun, 14 October 2012 17:06 Go to previous messageGo to previous message
Martin Leese is currently offline  Martin Leese
Messages: 23
Registered: June 2012
Karma:
Junior Member
Peter H. Coffin wrote:

> On Sun, 14 Oct 2012 17:50:48 +0200, Michael Fesser wrote:
>> I wouldn't care too much about invalid inputs. Instead I would just take
>> what I get and see what I can do with it.
>>
>> So I would explicitly cast all values to int (invalid or empty values
>> will become 0), then just do a simple range check on all of the three
>> values and then do the math.
>
> Challenging curcumstance: "A" "B" "C" cast to int becomes 0:0:0, which
> is a valid time.

But not a valid *duration* (which is what
the OP actually wants).

--
Regards,
Martin Leese
E-mail: please(at)see(dot)Web(dot)for(dot)e-mail(dot)INVALID
Web: http://members.tripod.com/martin_leese/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Curl chmod file transfer problem...
Next Topic: test
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 16:51:59 GMT 2024

Total time taken to generate the page: 0.04869 seconds