Hello there. I'm a web designer trying to learn more development skills. I've written this opening hours widget for wordpress. Its functionality is very simple which is all I really need and it does the job, however I'd love to know how to make the code smaller as there are lots of thing repeating. I think parts of it could be done using a for each loop and arrays, but I can't figure out what way to do it. If anyone can help or point me in the right direction for what topic specifically to study I would be very grateful. Please see code below. Sorry if its really badly written,
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.
Help with re-factoring repetitive code
in PHP Coding Help
Posted
Hello there. I'm a web designer trying to learn more development skills. I've written this opening hours widget for wordpress. Its functionality is very simple which is all I really need and it does the job, however I'd love to know how to make the code smaller as there are lots of thing repeating. I think parts of it could be done using a for each loop and arrays, but I can't figure out what way to do it. If anyone can help or point me in the right direction for what topic specifically to study I would be very grateful. Please see code below. Sorry if its really badly written,