note 70192 added to function.checkdate
| From: | minterior at gmail dot com | Date: | Fri, 06 Oct 2006 10:57:33 +0000 |
| Subject: | note 70192 added to function.checkdate | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-118121@lists.php.net to get a copy of this message | ||
A similar function is this, which check a time string in the form "h:m:s", with h,m,s 1 or
2 caracters long:
<?php
function check_time_string($time_string) {
$is_time_string = false;
if (ereg("^([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})$", $time_string, $parts)) {
$hora = intval($parts[0]);
$min = intval($parts[1]);
$seg = intval($parts[2]);
if($hora >= 0 && $hora <= 23)
if($min >= 0 && $min <= 59)
if($seg >= 0 && $seg <= 59)
$is_time_string = true;
}
return $is_time_string;
}
?>
----
Server IP: 130.206.1.5
Probable Submitter: 80.35.133.91
----
Manual Page -- http://www.php.net/manual/en/function.checkdate.php
Edit -- https://master.php.net/note/edit/70192
Del: integrated -- https://master.php.net/note/delete/70192/integrated
Del: useless -- https://master.php.net/note/delete/70192/useless
Del: bad code -- https://master.php.net/note/delete/70192/bad+code
Del: spam -- https://master.php.net/note/delete/70192/spam
Del: non-english -- https://master.php.net/note/delete/70192/non-english
Del: in docs -- https://master.php.net/note/delete/70192/in+docs
Del: other reasons-- https://master.php.net/note/delete/70192
Reject -- https://master.php.net/note/reject/70192
Search -- https://master.php.net/manage/user-notes.php