Parsing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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@xxxxxxxxxxxxxxxxxxxxx

   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.

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux