Parsing
| From: | Ron Piggott | Date: | Mon, 23 Feb 2015 04:33:41 +0000 |
| Subject: | Parsing | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-324499@lists.php.net to get a copy of this message | ||
I am wondering if someone could help me parse the text that appears above
"On 15-02-19 02:31 PM, The Verse of the Day Inquiries wrote:"
from the variable" $correspondence "
$correspondence = <<<EOF
Looking to see if this message is appended to the original ticket #
3784.
Sent to inquiries@theverseoftheday.info
On 15-02-19 02:31 PM, The Verse of the Day Inquiries wrote:
*=== To reply please type your response ABOVE THIS LINE ===* EOF;What I have worked out so far is: if ( strpos( $correspondence , '=== To reply please type your response ABOVE THIS LINE ===' ) ) {
$correspondence = substr(
$correspondence,
0,
strpos(
$correspondence,
'=== To reply please type your response ABOVE THIS LINE
==='
)
);
}
The date time and business e-mail account name will be dynamic. The type of pattern to match would be
- starting with "On"
- ending with "wrote:"
Thank you for any help / guidance.