Prova con:
Codice PHP:
echo htmlentities($stringa);