How can I get the parse email to only show the Date like Date: Tue, 01 May 2012 10:38:13 instead of the sample below
Date: Tue, 01 May 2012 10:38:13 -0400 Subject: Sample E-mail From:
user To: user Message-ID: Thread-Topic: Sample E-mail Thread-Index:
Ac0nqAlw+FJmG2FhRUuM8nhAxVUpjA== Mime-version: 1.0 Content-type:
multipart/alternative; boundary=\”B_3418713494_2606128\” >
$date2 = substr($email, strripos($email,"Date:")+strlen("Date:"));
$date = explode("Delivered To:", $date2);
echo "<br /><br /> Date: " . $date[0];
If you trust
Date:is followed bySubject:the following could work as an alternative to a Regex solution (and thus its overhead).