1
2 <?php
3$str = "This is some <b>bold</b> text.";
4echo htmlspecialchars($str);
5
6 ?>
1$string = "This is testing message "ETC" ";
2htmlspecialchars($string, ENT_COMPAT)
1$source = 'url of page with text with special characters';
2$html = file_get_contents($source,0);
3$html = mb_convert_encoding($html, 'UTF-8', mb_detect_encoding($html, 'UTF-8, ISO-8859-1', true));