在单个 ics 文件中添加多个事件后,我使用给定的代码更新单个 ics 文件中的多个事件。但它不起作用。事件未更新。任何机构请帮助我。我的代码给出:
$ical = "BEGIN:VCALENDAR";
$ical .= "\nVERSION:2.0";
$ical .= "\nPRODID:-//hacksw/handcal//NONSGML v1.0//EN";
$ical .= "\nMETHOD:REQUEST";
$ical .= "\nCALSCALE:GREGORIAN";
$ical .= "\nX-WR-RELCALID:asjh675adashdh";
$ical .= "\nX-WR-CALNAME:My Nov Calendar";
foreach($arr as $newArr){
$ical .= "\nBEGIN:VEVENT";
$ical .= "\nUID:" . md5($newArr['stDate']) . "example.com";
$ical .= "\nSEQUENCE:1";
$ical .= "\nDTSTAMP:" . gmdate('Ymd');
$ical .= "\nORGANIZER:catalog@example.com";
$ical .= "\nDTSTART:".$newArr['stDate'];
$ical .= "\nDTEND:".$newArr['stDate'];
$ical .= "\nSUMMARY:".$newArr['sub'];
$ical .= "\nDESCRIPTION:".$newArr['desc'];
$ical .= "\nCLASS:PUBLIC";
$ical .= "\nSTATUS:CONFIRMED";
$ical .= "\nTRANSP:TRANSPARENT";
$ical .= "\nEND:VEVENT";
}
$ical .= "\nEND:VCALENDAR";
header('Content-type: text/calendar; charset=utf-8');
header('Content-Disposition: inline; filename=my-calendar.ics');
echo $ical;
exit;
我也更改了序列号,但它不起作用。