I am wondering if it is possible to remove only =20 from the end of multiple lines within a block of text? This is for my e-mail to ticket gateway. When a reply is received and contains multiple "=20" I want to remove them. However I want to leave =20 intact if it is legitimately part an e-mail (such as a URL). An example of an incoming e-mail:
$correspondence = <<<EOF
Hello=20
=20
Thank you for getting back to me.=20
The link you need is http://domain.com/index.php?id=204726 .=20
Regards=20
EOF;