How can I use PHP to dynamically publish an ical file to be read by Google Calendar?

前端 未结 7 661
名媛妹妹
名媛妹妹 2020-11-28 17:18

Any Google search on PHP ical just brings up phpicalendar and how to parse or read IN ical files. I just want to write a PHP file that pulls events from my database and writ

7条回答
  •  囚心锁ツ
    2020-11-28 18:16

    Make sure you format the string like this or it wont work

     $content = "BEGIN:VCALENDAR\n".
                "VERSION:2.0\n".
                "PRODID:-//hacksw/handcal//NONSGML v1.0//EN\n".
                "BEGIN:VEVENT\n".
                "UID:".uniqid()."\n".
                "DTSTAMP:".$time."\n".
                "DTSTART:".$time."\n".
                "DTEND:".$time."\n".
                "SUMMARY:".$summary."\n".
                "END:VEVENT\n".
                "END:VCALENDAR";
    

提交回复
热议问题