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
Other options include
using a date calendar widget (js) to fill the field
splitting the date field into three separate selects and building the date on
the server from those three elements
Bastien From: [EMAIL PROTECTED] To: [EMAIL PROTECTED];
php-general@lists.php.net Date: Wed, 8 Aug 2007
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
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)
--
OOzy
Ubuntu-Feisty
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
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
5 matches
Mail list logo