Logical reason for strtotime('east') and strtotime('west') returning valid results?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Long time no speak!


As part of a quick filter I'm writing I try to interpret free text
strings as dates and textual data.

Sometimes, this goes wrong.

For example, I discovered that some words (or strings beginning with
those words) will return false positives:

e.g.:

[colin@jimmy Search (working)]$ php -r 'var_dump(strtotime("east"));'
int(1270514111)
[colin@jimmy Search (working)]$ php -r 'var_dump(strtotime("west"));'
int(1270488914)
[colin@jimmy Search (working)]$ php -r 'var_dump(strtotime("now"));'
int(1270488928)


The last one is valid! But the other two appear to do much the same thing...

Can anyone think of why this would be valid results before I report this
to the relevant authorities?

Col

-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mandriva Linux Contributor [http://www.mandriva.com/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux