PHP statement date comparison

Source: Internet
Author: User
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
      

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.