Re: Check if var has a date (timestamp or regular)
| From: | Richard Lynch | Date: | Wed, 08 Aug 2007 01:33:49 +0000 |
| Subject: | Re: Check if var has a date (timestamp or regular) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-260380@lists.php.net to get a copy of this message | ||
On Mon, August 6, 2007 6:52 am, OOzy Pal wrote:
> How can I check an inputed date if it is a valid date and if it is in
> the form of a timestamp or regular date such as (22-07-2007 or
> 22/07/2007)
Use the cool new "filter" extension to PHP or use PCRE.
http://php.net/filter
http://php.net/pcre
There was also an article in php|architect a few months back about
having the same PCRE for PHP and Javascript client-side validation, so
that you have a consistent set of "rules" in client-side validation
(better user experience) and server-side (actual security)
ymmv
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?