如何在PHP中导入.ics文件并将数据存储在数据库中?

时间:2017-05-17 05:30:55

标签: php mysql

  1. 我有一个我要导入的ICS文件。
  2. 并以PHP格式将其数据存储在我的数据库中。
  3. ICS文件内容===>

    BEGIN:VCALENDAR
    VERSION:2.0
    PRODID:-//Microsoft Corporation//Outlook 12.0 MIMEDIR//EN
    METHOD:REQUEST
    
    BEGIN:VTIMEZONE
    TZID:Europe/Berlin
    X-LIC-LOCATION:Europe/Berlin
    BEGIN:DAYLIGHT
    TZOFFSETFROM:+0100
    TZOFFSETTO:+0200
    TZNAME:CEST
    DTSTART:20000326T020000
    RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3
    END:DAYLIGHT
    BEGIN:STANDARD
    TZOFFSETFROM:+0200
    TZOFFSETTO:+0100
    TZNAME:CET
    DTSTART:20001029T030000
    RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10
    END:STANDARD
    END:VTIMEZONE
    
    BEGIN:VEVENT
    CLASS:PUBLIC
    UID: 59115b727dd92
    DTSTAMP:20170509T080226Z
    SUMMARY:Radwechsel
    LOCATION:HNG_FI_Germering,Filiale Germering - 16,Augsburger Str. 2,82110,Germering,DE
    PRIORITY:5
    TRANSP:OPAQUE
    ORGANIZER;CN=chaudhary:MAILTO:test1@test.de
    ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE:MAILTO:test1@test.de
    
    DTSTART;TZID="Europe/Berlin":20170512T093000
    DTEND;TZID="Europe/Berlin":20170512T112100
    
    BEGIN:VALARM
    ACTION:DISPLAY
    DESCRIPTION:REMINDER
    TRIGGER:-PT900S
    END:VALARM
    
    END:VEVENT
    END:VCALENDAR
    

1 个答案:

答案 0 :(得分:3)

===>请参阅此链接:https://www.phpclasses.org/package/9277-PHP-Parse-iCalendar-ics-files-to-extract-event-details.html#view_files

  1. 包括" iCalEasyReader.php"来自此链接的文件并回显您的 $ _FILES,您将获得一个.ics文件数组。