執行 ❯
獲取您
自己的 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 元素。這在防止使用者能夠在您的主頁上顯示輸入內容時執行程式碼時特別有用。