This is a PHP port of email-forward-parser by Crisp OSS.
All credit goes to them.
composer require stechstudio/email-forward-parser
use STS\EmailForward\Parser;
$parser = new Parser();
$result = $parser->read($emailBody, $emailSubject);
echo $result['forwarded']; // true
echo $result['email']['from']['address']; // [email protected]
See https://github.com/crisp-oss/email-forward-parser/blob/master/README.md for more usage examples.
MIT