简体   繁体   中英

How to display the special characters with a combination of PHP code snippet in it

Am trying to display some random combination of special characters. Am already using UTF-8 encode. But sometimes due to the combination of <? the remaining characters followed by this combination are not displayed.

For example: For the below HTML code

<p>MRTest007865@%$%$%^$%><?Ñ£©¶</p>

I expect the output as:

MRTest007865@%$%$%^$%><?Ñ£©¶

But the actual output is:

MRTest007865@%$%$%^$%>

Try this using utf8_encode function

echo utf8_encode("MRTest007865@%$%$%^$%><?Ñ£©¶");

you can also try to use htmlspecialchars check the documentation here: https://www.php.net/manual/en/function.htmlspecialchars.php

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM