Date: 10/14/01
- Next message: Christian Dechery: "Re: [PHP] problem of nesting includes..."
- Previous message: Alexander Deruwe: "[PHP] PHP on Debian with PDFlib"
- In reply to: James, Yz: "[PHP] Re: Time Processing"
- Next in thread: Philip Olson: "Re: [PHP] how to set font colors"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi,
|> function CheckTime($t) {
|> /* Checks the value of a 24-hour formatted time to be correct.
|> Returns 0 if bad time format, 1 otherwise.
|> */
|> return ( ereg("[012][0-9]:[0-5][0-9](:[0-5][0-9])?", $t) );
|> }
|
|You'd need to adjust this, because by your regex, 29:00:00 would be a
|valid time.
Absolutely right. Thanks James.
This should work then:
return ( ereg("([01][0-9]|2[0-4]):[0-5][0-9](:[0-5][0-9])?", $t) );
Cheers.
|> function CheckTime($t) {
|> /* Checks the value of a 24-hour formatted time to be correct.
|> Returns 0 if bad time format, 1 otherwise.
|> */
|> return ( ereg("[012][0-9]:[0-5][0-9](:[0-5][0-9])?", $t) );
|> }
|
|You'd need to adjust this, because by your regex, 29:00:00 would be a valid
|time.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Christian Dechery: "Re: [PHP] problem of nesting includes..."
- Previous message: Alexander Deruwe: "[PHP] PHP on Debian with PDFlib"
- In reply to: James, Yz: "[PHP] Re: Time Processing"
- Next in thread: Philip Olson: "Re: [PHP] how to set font colors"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

