ed, 8 Aug 2007 16:50:39 +0530> Subject: RE:
[PHP] Check if var has a date (timestamp or regular)> > Hi,> > You need to
check with your submitted data as in which format it is. Try> with different
combination for splitting the string (include -, / while> splitting string). If
Hi,
You need to check with your submitted data as in which format it is. Try
with different combination for splitting the string (include -, / while
splitting string). If input string works with split then assume input string
as in above format. Otherwise simple, consider it as in timestamp.
But
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
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)
You could first check if the variable consists only of numbers. If so,
it's likely a timestamp. If $var does consist of something ot
4 matches
Mail list logo