I have a "marked up document" containing pure text and HTML. I want a PHP function to strip out all of the weird characters (like +-& etc) and leave the HTML as it is :
echo htmlspecialchars_decode(htmlentities(implode('', file("articles/text.txt"))));
That should :
1) Convert all weird chars into their HTML entities " etc
2) Convert back all the HTML based ones into pure html.
3) Echo (dump) the text into the page.
So why do I still get weird chars?
echo htmlspecialchars_decode(htmlentities(implode('', file("articles/text.txt"))));
That should :
1) Convert all weird chars into their HTML entities " etc
2) Convert back all the HTML based ones into pure html.
3) Echo (dump) the text into the page.
So why do I still get weird chars?