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