On Saturday 11 January 2003 21:38, Dhaval Desai wrote:
> Hello ppl,
>
>
> Well, I want to compate date is php, could anybody tell me which is the
> best way to do so? I have tried various ways but nothing seems consistent.
> I tried for example:
> if("2003-1-15" > "2003-1-11")
> {
> echo "true";
>
> }
> which doesn't work in some cases...

Actually the above should work in all cases as you're comparing two strings 
constants :)

In any case if your dates are in ISO format (YYYY-MM-DD) then simple 
comparison using >, <, ==, etc should always work fine.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
"Who cares if it doesn't do anything?  It was made with our new
Triple-Iso-Bifurcated-Krypton-Gate-MOS process ..."
*/


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

Reply via email to