I am looking for a script which will allow me to display some text 'Open Now' on a certain day and time of the week and 'Closed' on the other days. I'm a complete newb in javascript/php so i'm not sure how to even start this, although i have an idea.
if ( date("w") == 5 ) { echo "Sorry, the internet is closed today!"; } else { echo "Open for business!"; }
?>
Explanation: the code first checks if today's day number of the week (from 1-7), equals 5 (=friday). If that is so, it will show the text Sorry, the internet is closed today. If it isn't 5, it will show the text Open for business! Ofcourse, this code can be extended, but it should get you started.
Can anyone help me with this one?
Regards.
Explanation: the code first checks if today's day number of the week (from 1-7), equals 5 (=friday). If that is so, it will show the text Sorry, the internet is closed today. If it isn't 5, it will show the text Open for business!
Ofcourse, this code can be extended, but it should get you started.
Say 9:00am - 5:30 for 'X' days but i'm not sure the on the php syntax for that.
So
$datestart = 9
$dateend = 17
If(date('G') >= $datestart && date('G') <= $dateend && date('w') == '5'){<br />
Do what ever
}