Re: Way to test if variable contains valid date
| From: | Daniel Brown | Date: | Mon, 02 Jul 2012 18:58:50 +0000 |
| Subject: | Re: Way to test if variable contains valid date | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-318370@lists.php.net to get a copy of this message | ||
On Mon, Jul 2, 2012 at 2:54 PM, Ron Piggott
<ron.piggott@actsministries.org> wrote:
>
> Is there a way to test a variable contains a valid date
> - 4 digits for the year
> - 2 digits for the month (including leading 0)
> - 2 digits for the day (including leading 0)
>
> OR
>
> - a function?
You may want to check out checkdate():
http://php.net/checkdate
--
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/