Using PHP getdate(); I get the following array output:
Array (
[seconds] => 54
[minutes] => 26
[hours] => 19
[mday] => 10
[wday] => 5
[mon] => 12
[year] => 2021
[yday] => 343
[weekday] => Friday
[month] => December
[0] => 1639164414
)
I want to use if the value [yday]
equals a particular number then echo message but unsure how this can be done. The idea is to have a different message echo each day - I know how to do this in JavaScript but been tasked with doing it in PHP which is something I'm still learning.
For example if yday = 100 echo message, if yday = 200 echo different message.
So, if there is 365 days in a year I simply want to output (echo) a different message every day of the year based on the yday number. It doesn't need to be an exact time/zone, the message must stay static and we don't want it to be random, or use cookies with random to store it for 24 hours.
There might even be a better way of doing this without yday, any help appreciated.