PHP Eshop Closing Time Code Message

PHP Eshop Closing Time Code Message AWwCAAFnzgFlAAAAAElFTkSuQmCC

I was recently asked to code a little widget for someone’s Eshop to display a message at a certain time of day to say if they were open or closed.

The shop’s opening hours were 8:00am – 11:30am then 4:00pm – 10:00pm.

= $open_AM && $t <= $close_AM)
{
echo "Shop Open";
}
else if($t >= $open_PM && $t <= $close_PM)
{
echo "Shop Open";
}else{
echo "Shop Closed";
}

//Plus 2 Hours
$t=time() + $offset;
echo "Plus 2 hours: ";
echo(date("D F d Y H:i:s",$t));
?>

I will now break this code down for you.

Total
0
Shares
Leave a Reply

Your email address will not be published. Required fields are marked *


Previous Post
Piper Ford Focus ST Replica Exhaust System - 2.0l Ford Focus

Focus ST Lookalike Piper Replica Exhaust

Next Post
PHPBB Community Forum - Remove ViewForum

PHPBB: Remove Viewtopic/Viewforum From Title

Related Posts