I have a script (from GitHub) that uses the Google Calendar API to display upcoming events.
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="format-google-calendar.js"></script>
<script>
formatGoogleCalendar.init({
calendarUrl: 'https://www.googleapis.com/calendar/v3/calendars/7aqribjvrco83j69ufindoig3g@group.calendar.google.com/events?key=AIzaSyDls1AFdCYUTxYRWpYNUiLwOarKao3WV_c',
past: true,
upcoming: true,
sameDayTimes: true,
pastTopN: 20,
upcomingTopN: 3,
itemsTagName: 'li',
upcomingSelector: '#events-upcoming',
pastSelector: '#events-past',
upcomingHeading: '<h2>Upcoming events</h2>',
pastHeading: '<h2>Past events</h2>',
format: ['*date*', ': ', '*summary*', ' — ', '*description*', ' in ', '*location*']
});
What I want to do is store different parts of the data in a PHP variable per event, for instance:
<?php
$date= JSON Date
<--! For next event !-->
$date2= JSON Date2
$date3= JSON Date3
?>
I only need 3 as it will only be displaying 3 upcoming events.