|
Posted by Leif Gregory on 08/29/05 17:29
Hello babu,
Monday, August 29, 2005, 6:50:32 AM, you wrote:
> how can i write regular expression for time in 24-hour format i:e,
> HH:MM:SS. using preg_match.
<?php
$xtime="19:59:53";
if (preg_match("/([01][0-9]|[2][0-3]):[0-5][0-9]:[0-5][0-9]/", $xtime))
echo "Good";
else
echo "Bad";
?>
-- TBUDL/BETA/DEV/TECH Lists Moderator / PGP 0x6C0AB16B
__ ____ ____ ____ Geocaching: http://gps.PCWize.com
( ) ( ___)(_ _)( ___) TBUDP Wiki Site: http://www.PCWize.com/thebat/tbudp
)(__ )__) _)(_ )__) Roguemoticons & Smileys: http://PCWize.com/thebat
(____)(____)(____)(__) PHP Tutorials and snippets: http://www.DevTek.org
Save your pennies. The dollars go to the I.R.S.
Navigation:
[Reply to this message]
|