執行 ❯
獲取您
自己的 PHP
伺服器
×
更改方向
更改主題,深色/淺色
前往 Spaces
<!DOCTYPE html> <html> <body> <?php $str = '<a href="https://w3schools.tw">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.tw">訪問 w3schools.com</a>
將字元轉換為實體通常用於防止瀏覽器將其用作 HTML 元素。這在阻止使用者在您的主頁上顯示輸入時執行程式碼時特別有用。