how to put specific strings in array with specific keys PHP
I have a string pulling from a socket:
PRODID:-//Microsoft Corporation//Outlook 10.0 MIMEDIR//EN
VERSION:2.0
METHOD:PUBLISH
X-CALENDARSERVER-ACCESS:PUBLIC
BEGIN:VTIMEZONE
TZID:Pacific Time
BEGIN:STANDARD
DTSTART:20081101T020000
RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU
....
I would like to have it so it is like this:
$data['PRODID'] = -//Microsoft Corporation//Outlook 10.0 MIMEDIR//EN
$data['VERSION'] = 2.0
.......
I did try parse_str but that didn't work. Is there a easy way?
Thanks
No comments:
Post a Comment