I've got a multidimensional array that stores the location and date of gigs that looks something like this
for ($i=0; $i < $numberOfGigs ; $i++) {
$gig[$i] = array(
"date" => $date,
"place" => $location
);
}
I'm getting the date and location from the Google Calendar API and then building a table using the data, however the API's response lists the events in the date they were added to the calendar, rather than the date of the event. This gives me a table looking something like this.
15/03/2014 - Venue 1
30/03/2014 - Venue 2
06/04/2014 - Venue 3
16/03/2014 - Venue 4
I obviously want the events in the table to be sorted chronologically, so I'm looking for a way to sort my $gig array so that $gig[0] is the earliest date and $gig[5] is the latest. I've been looking into sorting arrays, however I'm having trouble getting my head around this multidimensional example.
If anyone could point me in the right direction that would be greatly appreciated!