coryetzkorn / php-store-hours

Output content based on time-of-day and-day-of-week.
MIT License
136 stars 55 forks source link

Error when using the store hours. #5

Closed dnafviii closed 9 years ago

dnafviii commented 9 years ago

Hi,

I just wanna say awesome code. I have followed the instructions and seem to keep coming up with the below error:

Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\store-hours\StoreHours.class.php on line 66

I am unsure how to fix this issue at the moment. All I have done is put the two files: index.php and StoreHours.class.php in a folder and viewed it in a browser without touching any of the code and the error pops up.

I think it has to do with the $hours array and leaving the days closed blank: ('sun' => '' // Closed all day). I noticed when I fiddled with the times trying different formats the errors would change. Is there a better way to code the closed times that will complement the code?

Thank you for your time and consideration,

Dan Stachlewski store-hours-issue

coryetzkorn commented 9 years ago

Thanks Dan... I'll look into this ASAP!

coryetzkorn commented 9 years ago

Hi Dan,

I’ve pushed an update to GitHub that should fix this issue.

Happy holidays! Cory

On Dec 14, 2014, at 5:49 AM, dnafviii notifications@github.com wrote:

Hi,

I just wanna say awesome code. I have followed the instructions and seem to keep coming up with the below error:

Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\store-hours\StoreHours.class.php on line 66

I am unsure how to fix this issue at the moment. All I have done is put the two files: index.php and StoreHours.class.php in a folder and viewed it in a browser without touching any of the code and the error pops up.

Thank you for your time and consideration,

Dan Stachlewski https://cloud.githubusercontent.com/assets/5877103/5427092/0c2ee662-83db-11e4-8719-ad2155d80d65.png — Reply to this email directly or view it on GitHub https://github.com/coryetzkorn/php-store-hours/issues/5.