Hi, I am trying to program a email piping php script that would take an incoming traffic update report via email, and extract the relevant information within it to store into a database.
The email usually starts with some introduction, with the important information displayed in the following format.
Highway : Some Highway
Time : 08-Oct-2010 08:10 AM
Condition : Smooth (or slow moving etc)
I tried with this code
preg_match_all('/(?P<\name>\w+) : (?P<\data>\w+)/i', $subject, $result);
Note the < / are really just < but somehow they are not being displayed here.
And the matches are only:
Highway : Some
Datetime : 08
Condition : Smooth
Can anybody tell me what's missing in my second regex expression? Why doesn't it include the entire string of words after the ":"?