<?php
$data = array();
$data['events'] = array();

foreach ($context as $eventInstance) {
    $data['events'][] = $eventInstance->toJSONData();
}

echo json_encode($data);
<?php
$data = array();
$data['Events'] = array();

foreach ($context as $eventInstance) {
    $data['Events'][] = $eventInstance->toJSONData();
}

echo json_encode($data);
Use uppercase "E" to correspond to previous output
Use uppercase "E" to correspond to previous output
