attempting to parse a ICal RRule string
RRULE:FREQ=DAILY;INTERVAL=1;BYDAY=TU,WE,FR;UNTIL=20110713T075959Z;WKST=SU
I'm building a drupal site and the Date module outputs this code, which I need to display on a page in a more readable format.
I jus开发者_运维问答t want to get the days and the end date which is the UNTIL.
I'm not sure how to approach it. I'm not very good with regular expressions.
I would just cheat and parse it as a query string:
parse_str(strtr($YOUR_STRING, ';', '&'), $data);
And then you can further process it, e.g. split the BYDAY
:
$byDays = explode(',', $data['BYDAY']);
精彩评论