扫码一下
查看教程更方便
解析:
htmlentities() 函数把字符转换为 HTML 实体
$html = <<<EOF
<html>
<head>
<title>迹忆客</title>
</head>
<body>
<span>迹忆客</span>:<span>https://www.jiyik.com</span>
</body>
</html>
EOF;
$res = htmlentities($html);
echo $res;
执行结果
<html>
<head>
<title>迹忆客</title>
</head>
<body>
<span>迹忆客</span>:<span>https://www.jiyik.com</span>
</body>