Sorting array of events based on dates in PHP?

This will loop through the events and echo matching events (you need to create the array).

The way I'd approach it would be to first parse the Calendar text into an array. To make things easier I'd declare an Event class to organise each event and store pertinent information. I'd declare a method within the Event class called something like is_active, which takes an DateTime argument as its only parameter and returns true or false depending on whether the date falls within the event's start/end dates.

From there it's pretty easy to filter your existing array of all events into subsets for a particular date if you need it.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions