Re: Way to test if variable contains valid date
| From: | shiplu | Date: | Tue, 03 Jul 2012 10:45:15 +0000 |
| Subject: | Re: Way to test if variable contains valid date | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-318387@lists.php.net to get a copy of this message | ||
>
>
> I want to thank you, Daniel, for this help. - I was looking for an
> "isarray" type function
There is no such function or facility in php. However you can check date in
string by DateTime object also
try {
$date = new DateTime('2000-01-01');
} catch (Exception $e) {
echo $e->getMessage();
exit(1);
}
Check php.net/datetime.construct
--
Shiplu.Mokadd.im
ImgSign.com | A dynamic signature machine
Innovation distinguishes between follower and leader