Question:

PHP date() function?

by  |  earlier

0 LIKES UnLike

Can someone please tell me how to write something like the following in PHP using the date() function...

...if the current time is between Tuesday, Sept 9th at 8:00 AM and Sunday, Sept 14th at 1:00 PM, then...

 Tags:

   Report

1 ANSWERS


  1. First you need to get a date str:

    $date_str = date("ymdh");

    Then do a string compare.

    if ((strcmp($date_str, "2008090908") >= 0)

       && (strcmp($date_str, "2008091413") <= 0))  {

         ;

    }

    Good luck,

    peng

    http://www.eptop.com

You're reading: PHP date() function?

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.
Unanswered Questions