php字符串转换为html

Val*_*Val 2 php character

我有一个字符串<div id="myid">......</div>

我怎么会把它改成 <div id="myid">......</div>

我尝试过一些东西,但没有任何帮助吗?

更新

function get_page(){
  $file = 'file.php';
  $str = file_get_contents($file);
  $str = html_entity_decode($str);
  return $str;
}
$output = get_page();
echo $output;//don't work
Run Code Online (Sandbox Code Playgroud)

固定

function get_page(){
      $file = 'file.php';
      $str = file_get_contents($file);
      return $str;
    }
    $output = get_page();
    echo html_entity_decode($output);//works
Run Code Online (Sandbox Code Playgroud)

Pek*_*ica 15

功能就是htmlspecialchars_decode().

请注意,对于解码引号的函数,您需要指定$quote_style参数.