note 17259 added to function.checkdate
| From: | php-general at lists dot php dot net | Date: | Sun, 02 Dec 2001 07:53:47 +0000 |
| Subject: | note 17259 added to function.checkdate | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-21523@lists.php.net to get a copy of this message | ||
One thing I am seeing in all these replies is that you are assuming the user (idiot) is going to
enter a date in the format you want. What if they enter "my dog?" Here are some other
entries that wouldn't pass through the sample codes I've seen so far:
Nov 31, 70
November 31, 1970
11 31, 70
11/31.1970
Never underestimate stupid users.
With ASP I could simply throw anything into IsDate("Insert_Input_Here") and it would tell
me if that value was a date or not. From there I was free to format it anyway I wanted to.
I have switched from ASP to PHP and I'm amazed that such a basic request is not taken care of
naturally, instead of coming up with hacks to do the job.
Signed,
Sad
--
http://www.php.net/manual/en/function.checkdate.php
http://master.php.net/manage/user-notes.php?action=edit+17259
http://master.php.net/manage/user-notes.php?action=delete+17259
http://master.php.net/manage/user-notes.php?action=reject+17259