utf 8 - How to display/echo html as text in php with utf-8 text in it? -
I am trying to display the html / html code text as it is in php I used the htmlentitied () function Tried, but it transforms the entire text into HTML entities
In my problematic situation, I have the following HTML text:
$ HTML = ' & Lt; / Tr & gt; & Lt; / Tags & gt; & Lt; / Table & gt; & Lt; Br / & gt; Early brown fox jumps on the lazy dog; Div & gt; Æ ???? Æ ?? · Ç ???? Æ £ ?? job ?? ²ç ???? Ç ?? E · ?? È¿? ? Æ ???? Ç ???? & Lt; / Div & gt; & Lt; Br> & Lt; Div & gt; Æ ?? Æ ?? ° ã ?? § ?? ¥ one ¥? A ?? ®e ???? à ???? job ?? Èè ?? ²ã ?? ®ã ?? à ??? One ???? A ?? One ?? £ a ?? ³ã ???? & Lt; / Div & gt; & Lt; Br> & Lt; Div & gt; ʲ ?? I ?? ¼ ¥ ¸ e ° ?? ¥ ¼ í ?? Μí ?? '˹ ë ¥ ¸ e ° ?? I ???? "??" â ?? Ì í í ???? & lt; / div>
gt; ² ³ ?? ²® ²² ²²²² ²²²²²² ??²²²²²²??a=²²²²??²²?a=²²??a²²àn ??? Eclair ??? ²² ?? AK? AK²²? A² ?? A².a. ²²²²²²²²²²²²??²=?< / div>
ê² ?? i ?? ¼ ¥ ¸ è ° ?? ¥ ¼ í ?? μí ?? 'ë¹ ë ¥ ¸ e ° ?? I ???? "???? "¬ ?? Ì í í ???? & Lt; / Div & gt; & Lt; Br> & Lt; Div & gt; ×? × ¢ × ¨ × ?? × ?? × ?? × × ?? ¨ × ?? × ?? × ?? × × × × × × × × ×¼¼ × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × ×? × × × × × × ¢ × ¨ × ?? × ?? × × × ?? × ?? × ?? × × ?? ?? × × ?? & Lt; / Div & gt; & Lt; Br> & Lt; Div & gt; ¤ ?? ¤²à ¥ ¥ ?? ¤ ?? ¥ ?? When ¥ ¥ ठ?? ?? ¤ªà¤ à à¤? ¥? ¥ ?? ¥ ¥ ¥ ?? ¥ ¥ à¤ à ¥ ?? ?? Aerate ?? ¤²à ¥ ?? Typewriter ¤ ?? ¥ ?? | & Lt; / Div & gt; & Lt; Br> & Lt; Div & gt; U ?? U ?? U ?? U ?? ز § u ?? Ø «Ø¹Ù ?? Hey u ?? Where ?? U ?? ا٠?? Ø³Ø ± Ù ?? ع Ù ?? Ù ?? Ù ?? ا٠?? Ù ?? Ù? Ø ¨ § §? Ù ?? س٠?? Ù ?? & Lt; / Div & gt; & Lt; Br> & Lt; Div & gt; La Sig ¼ A ± A Tocaba El Saxof ³ ³ sobre el perro perezoso & lt; / Div & gt; & Lt; Br> & Lt; Div & gt; À § ?? À ° au | ¾à | àà | ¾à | ® §§ ?? Amerika ?? À || ààààààà¾à | ²²²à | ¾à || «& Lt; / Div & gt; & Lt; Br> & Lt; Div & gt; × ?? × × × ?? × ¢ × ?? × × ?? ?? × ?? × ?? × × ?? ?? × ¨ × ?? × ?? × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × × ×? × × ?? ?? × ?? × ?? × ?? × × × × | × ?? × ?? & Lt; / Div & gt; & Lt; Br> '; Echo htmlentities ($ html); The above code gives me lots of garbage text in the output. Is there any way I can be like that UTF-8? I'm actually looking for a lot like the "code sample" function in the StackHowflow editor.
Specify the charset as URF-8:
echo Htmlentities ($ Html, ENT_COMPAT, 'UTF-8');
Comments
Post a Comment