function checktime($h, $m, $s) {
return $h >= 0 && $h < 24 && $m >= 0 && $m < 60 && $s >= 0 && $s < 60;
}
A statement that calls the custom function:
$valid_time = checktime(12, 30, 0); // returns 1 (1 = true; 0 = false)