Код: Выделить всё
// Initializes a container array for all of the calendar events
$jsonArray = array();
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$id = $row['HolidayType'];
$title = $row['name'];
$start = $row['start'];
$end = $row['end'];
// Stores each database record to an array
$buildjson = array('title' => "$title", 'start' => "$start", 'end' => "$end", 'allDay' => false);
// Adds each array into the container array
array_push($jsonArray, $buildjson);
}
echo json_encode($jsonArray);
Код: Выделить всё
// Initializes a container array for all of the calendar events
$jsonArray = array();
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$id = $row['HolidayType'];
$title = $row['name'];
$start = $row['start'];
$end = $row['end'];
$start_time = $row['start_time'];
$end_time = $row['end_time'];
// Stores each database record to an array
$buildjson = array(
'title' => "$title",
'start' => "$start",
'end' => "$end",
'start_time' => "$start_time",
'end_time' => "$end_time",
'allDay' => false);
// Adds each array into the container array
array_push($jsonArray, $buildjson);
}
echo json_encode($jsonArray);
Подробнее здесь: https://stackoverflow.com/questions/960 ... s-to-dates
Мобильная версия