I’m having some trouble decoding & to & within a mail function:
This is the code:
$betreff = $_REQUEST["Betreff"];
$betreffUTF8 = "=?UTF-8?B?".base64_encode($betreff)."?=";
$betreffFinal = str_replace('$amp;', '&', $betreffUTF8);
I’m pretty sure it should work like that, but for some reason it doesn’t.
Any idea?
Update:
Yes, the $amp; was just a typo.
You won’t find any
&inside abase64_encode()ed string 🙂I’ve reversed the operation by first replacing the
&and then applyingbase64_encode().