PHP - 将&#62和其他符号转换为文本

I have to convert these symbols:

  • &#62 ;
  • &#9996 ;
  • ...

etc.

to:

  • >

How I can do it? Is anyone function in PHP to do it?

You can use PHP's html_entity_decode() function:

<?php
    $str = "&#62;";
    $str = html_entity_decode($str);

    $str1 = "&#9996;";
    $str1 = html_entity_decode($str1);
?>

More information at http://php.net/manual/en/function.htmlentities.php.

Note: html_entity_decode() function is the opposite of htmlentities() function.

Hope this helps, thanks!

<?php
$str = "This is some &lt;b&gt;bold&lt;/b&gt; text.";
 echo htmlspecialchars_decode($str);
 ?>

htmlspecialchars_decode