Skip to content
Advertisement

Selecting data from array, based on day of the week using PHP

I have the following code, taken from another question:

JavaScript

It is working as is, but i want to be able to output the schedule for the current day, for example:

JavaScript

How can i do this? I understand that date('D') outputs the current day (Thu), but i have not been able to make it work to extract the desired data from the array.

Advertisement

Answer

The simplest solution as per your question is below, rest of the functions you can use or you can use according to your logic.

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement