/ Published in: PHP

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// Get the dates $datefrom = "10/01/2010"; $dateto = "10/12/2010"; // Convert dates to strings // Compare the dates (check if today is between start and end dates) if ($todaystring >= $datefromstring && $todaystring <= $datetostring) { // Do something if today is in between echo "Date is ok."; } else { // Do something if it is not in between echo "Date is wrong."; }
Comments
