strtotime()returns false if it cannot understand your date format, so you can check its return value. The function has no side effects, so trying to call it will not hurt.
// $format = ...
if (($timestamp = strtotime($format)) !== false) {
// Obtained a valid $timestamp; $format is valid
} else {
// $format is invalid
}
, , strtotime() Unix, . , false . manual:
, , Fri, 13 Dec 1901 20:45:54 UTC to Tue, 19 Jan 2038 03:14:07 UTC. ( , 32- .) , , , Unix. , , , 1 1970 . Windows, Linux . PHP 5.1.0 .
64- PHP , 64 293 .
, 32- Unix , 64- .