运行 ❯
获取您
自己的 PHP
服务器
×
更改方向
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <body> <?php $str = '<a href="https://w3schools.org.cn">Go to w3schools.com</a>'; echo htmlentities($str); ?> <p>Converting characters into entities are often used to prevent browsers from using it as an HTML element. This can be especially useful to prevent code from running when users have access to display input on your homepage.</p> </body> </html>
<a href="https://w3schools.org.cn">访问 w3schools.com</a>
将字符转换为实体通常用于防止浏览器将其用作 HTML 元素。这在阻止用户在您的主页上显示输入时运行代码时特别有用。