I've got some emails in the form of .eml files where I want to parse out some values and insert them in a MySQL DB.
For example.
Code:
TYPE: TEST
FIRST_NAME: JOHN
LAST_NAME: DOE
VISIT_CODE: 999-99-9999
AUTH: 9999999-99999
BEGIN:VTIMEZONE
TZID:(GMT-08.00) Pacific Time (US & Canada)/Tijuana
X-MICROSOFT-CDO-TZID:13
BEGIN:STANDARD
DTSTART:16010101T020000
TZOFFSETFROM:-0700
TZOFFSETTO:-0800
RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=11;BYDAY=1SU
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:16010101T020000
TZOFFSETFROM:-0800
TZOFFSETTO:-0700
RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=3;BYDAY=2SU
END:DAYLIGHT
END:VTIMEZONE
What is the best way to approach this? Any suggestions. I don't need to read the email boxes, I've already got that part handled, I just need to take something like the above text (which I already have in a string) and parse the values and insert.
Perhaps Regex in PHP would be easiest.
Recent comments
1 day 15 hours ago
1 day 23 hours ago
2 days 2 hours ago
2 days 4 hours ago
2 days 5 hours ago
2 days 7 hours ago
2 days 8 hours ago
2 days 9 hours ago
3 days 1 hour ago
3 days 2 hours ago