SetToLoki Posted July 3, 2009 Share Posted July 3, 2009 I have an array or calendar events, each event in the array looks likethis PRODID:-//Kerio Technologies//Kerio MailServer//EN METHOD:PUBLISH VERSION:2.0 X-VERSION-KMS:6.2.0 X-CALENDARSERVER-ACCESS:PUBLIC BEGIN:VTIMEZONE TZID:Dublin, Edinburgh, Lisbon, London BEGIN:STANDARD DTSTART:19961027T020000 TZOFFSETTO:+0000 TZOFFSETFROM:+0100 RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU END:STANDARD BEGIN:DAYLIGHT DTSTART:19810329T010000 TZOFFSETTO:+0100 TZOFFSETFROM:+0000 RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU END:DAYLIGHT END:VTIMEZONE BEGIN:VEVENT DTSTAMP:20090703T091907Z UID:7d593fe6-0a7d-4a82-bd1a-11a6f9276e4c SEQUENCE:0 SUMMARY:Problems Log LOCATION:Intranet DTSTART;TZID="Dublin, Edinburgh, Lisbon, London":20090703T103000 DTEND;TZID="Dublin, Edinburgh, Lisbon, London":20090703T110000 CLASS:PUBLIC PRIORITY:5 TRANSP:OPAQUE X-MICROSOFT-CDO-BUSYSTATUS:BUSY X-LABEL:0 DESCRIPTION:If event is deleted in Kerio it doesnt get deleted from database.\n\nIdeas for fix: \nCron::calsync.php\n\nUsing calsync check existing e ntries against the event array.\nIf row exists in table but not in array dele te the row. \nWill need to loop through each row and check it against array. this could be a long process, test speeds. END:VEVENT END:VCALENDAR I want to store each line of this into a new array, I did it by using explode using : but when someone uses : on their calendar the description field is broken into bits too I have no control over how the data is entered into the initial array only into mine. Link to comment https://forums.phpfreaks.com/topic/164670-array-problem/ Share on other sites More sharing options...
gevans Posted July 3, 2009 Share Posted July 3, 2009 array explode ( string $delimiter , string $string [, int $limit ] ) Use the limit paramater. <?php explode(":", $your-string, 2); Link to comment https://forums.phpfreaks.com/topic/164670-array-problem/#findComment-868376 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.