PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I am currently using the following code to automatically generate messages for when my business will be closed base don the date of a holiday. This is working fine, but seems inefficient. Is there perhaps a more efficient or concise way to express the same code?
This way you only have to update the array and not touch the logic if you want to change the data. Also, I assumed the (-7) in your second condition was meant to be taken as seven days before the date, and since those time functions are counting seconds I multiplied it by the number of seconds per day.