在php中为fullcalendar重复数组日期

在php中为fullcalendar重复数组日期,php,Php,我必须能够在fullcalendar.io上查看重复的一系列抖动 使用我管理的php,重复一个数组,现在我很难在日历上显示它 这是密码 $aDate = '2016-09-20'; $rounds = array('Sera', 'Pomeriggio', 'Mattina', 'Notte', 'Riposo'); for($i=0; $i<20; $i++) { $nextDate = date("Y-m-d", strtotime('+1 day', strtotime($

我必须能够在fullcalendar.io上查看重复的一系列抖动

使用我管理的php,重复一个数组,现在我很难在日历上显示它

这是密码

$aDate = '2016-09-20';
$rounds = array('Sera', 'Pomeriggio', 'Mattina', 'Notte', 'Riposo');

for($i=0; $i<20; $i++) {
    $nextDate = date("Y-m-d", strtotime('+1 day', strtotime($aDate)));
    echo "\n<br>" . $nextDate . " " . $rounds[$i%count($rounds)];
    $aDate = $nextDate;
}
我在这个世界上尝试过,但没有成功。帮我解决一下

$aDate = '2016-09-20';
$rounds = array('Sera', 'Pomeriggio', 'Mattina', 'Notte', 'Riposo');
for($i=0; $i<20; $i++) {
    $nextDate = date("Y-m-d", strtotime('+1 day', strtotime($aDate)));

    $event_array[] = array(
            'id' => '1',
            'title' => $rounds[$i%count($rounds)],
            'start' => $nextDate,
            'color' => '#000'
        );

    $aDate = $nextDate;
}
$aDate='2016-09-20';
$rounds=array('Sera','Pomeriggio','Mattina','Notte','Riposo');
对于($i=0;$i'1',
“title”=>$rounds[$i%计数($rounds)],
“开始”=>$nextDate,
“颜色”=>“#000”
);
$aDate=$nextDate;
}

谢谢

请检查下面的代码[注意:我已设法制作了与您提到的类似的结构,您可以根据需要进行更改,以满足完整的日历需求]

<?php

$aDate = '2016-09-20';
$rounds = array('Sera', 'Pomeriggio', 'Mattina', 'Notte', 'Riposo');

$events = array();

for($i=0; $i<20; $i++) {
    $nextDate = date("Y-m-d", strtotime('+1 day', strtotime($aDate)));
    $event_array = array();
    $event_array['id'] = $i+1;
    $event_array['title'] = $rounds[$i%count($rounds)];
    $event_array['start'] = $nextDate;
    $event_array['color'] = '#000';

    $aDate = $nextDate;

    $events[] = $event_array;
}

$events = json_encode($events, JSON_PRETTY_PRINT);
print_r($events);
?>


请检查下面的代码[注意:我已设法制作了与您提到的类似的结构,您可以根据需要进行更改,以满足完整的日历需求]

<?php

$aDate = '2016-09-20';
$rounds = array('Sera', 'Pomeriggio', 'Mattina', 'Notte', 'Riposo');

$events = array();

for($i=0; $i<20; $i++) {
    $nextDate = date("Y-m-d", strtotime('+1 day', strtotime($aDate)));
    $event_array = array();
    $event_array['id'] = $i+1;
    $event_array['title'] = $rounds[$i%count($rounds)];
    $event_array['start'] = $nextDate;
    $event_array['color'] = '#000';

    $aDate = $nextDate;

    $events[] = $event_array;
}

$events = json_encode($events, JSON_PRETTY_PRINT);
print_r($events);
?>


代码已更新。。再检查一遍。。你需要做相应的调整@Sixdascode已更新。。再检查一遍。。你需要做相应的调整@六、你有没有在日历上使用js插件?如果是,请分享插件的名称好吗?@SachinVairagi我想使用插件和。我也在我的留言里写过。你在日历上使用js插件吗?如果是,请分享插件的名称好吗?@SachinVairagi我想使用插件和。我也在我的留言中写道。