PHP statement date comparison problem how to compare the size of the two dates startdate AND enddate in the form of this page when submitting the page, and make a judgment. Is there a date function that can be converted to a type with comparable sizes regardless of the type of date? I can't write JavaScript or ajax using php statements. thank you !, PHPcode & lt ;? Phpfunct PHP statement date comparison problem
How to compare the values of startdate AND enddate in the form of this page when submitting the page, and make a judgment.
Is there a date function that can be converted to a type with comparable sizes regardless of the type of date?
I can't write JavaScript or ajax using php statements. thank you!
------ Solution --------------------
PHP code
1, 'Feb' => 2, 'Mar '=> 3, 'Apr' => 4, 'may' => 5, 'June' => 6, 'July' => 7, 'Aug' => 8, 'sept' => 9, 'Oct' => 10, 'Nov' => 11, 'Dec '=> 12); $ m = substr ($ date, 0, strpos ($ date,'/'); $ good = str_replace ($ m, $ mon [$ m], $ date); // return the integer timestamp return strtotime ($ good);} $ date1 = "Apr/13/2012 "; $ date2 = "Apr/6/2012"; // The value is greater than that in January 1,. the result is truevar_dump (getTime ($ date1)> getTime ($ date2 ));
------ Solution --------------------
C/C ++ code
[User: liangdong Time: 13: 54: 44 Path :~ /Php] $ php date. php 2012/7/2 [User: liangdong Time: 13: 54: 46 Path :~ /Php] $ cat date. php
------ Solution --------------------
PHP code
cat: cat: No such file or directory