note 72837 added to function.strtotime
| From: | CaveatEmptor:Stringswith | Date: | Fri, 02 Feb 2007 18:01:53 +0000 |
| Subject: | note 72837 added to function.strtotime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-122570@lists.php.net to get a copy of this message | ||
Here is a strange "feature" of this function of which you should be aware:
If you use:
strtotime("NET")
...or...
strtotime("NET1000")
...or a bazillion other strings beginning with "NET"...
strtotime() will actually interpret these as a timestamp! I tested and verified this functionality
on PHP versions:
- Linux, PHP 5.1.6
- Windows, PHP 5.1.2
I have relied on this function to determine if a string is a date (as do many developers), but these
special "NET" strings must be an undocumented "feature," because there is
nothing to be found about it anywhere in the docs or on Google (at least that I can find).
----
Server IP: 200.185.109.13
Probable Submitter: 67.162.134.212 (proxied: 127.0.0.1)
----
Manual Page -- http://www.php.net/manual/en/function.strtotime.php
Edit -- https://master.php.net/note/edit/72837
Del: integrated -- https://master.php.net/note/delete/72837/integrated
Del: useless -- https://master.php.net/note/delete/72837/useless
Del: bad code -- https://master.php.net/note/delete/72837/bad+code
Del: spam -- https://master.php.net/note/delete/72837/spam
Del: non-english -- https://master.php.net/note/delete/72837/non-english
Del: in docs -- https://master.php.net/note/delete/72837/in+docs
Del: other reasons-- https://master.php.net/note/delete/72837
Reject -- https://master.php.net/note/reject/72837
Search -- https://master.php.net/manage/user-notes.php