运行 ❯
获取您
自己的 PHP
服务器
×
更改方向
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <body> <?php $str = "This is some <b>bold</b> text."; echo htmlspecialchars($str); ?> <p>Converting < and > 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>
This is some <b>bold</b> text.
将 < 和 > 转换为实体通常用于阻止浏览器将其用作 HTML 元素。这在防止用户能够在您的主页上显示输入内容时运行代码时特别有用。