Ano*_*eek 10 html php escaping
我想按原样打印以下文字:
echo "<label> AAAAA";
Run Code Online (Sandbox Code Playgroud)
但它只是显示'AAAAA'作为输出.
如何逃脱'<'和'>'符号.
小智 5
使用该htmlentities()
函数转换为纯文本字符串。
<?php
echo htmlentities("<label> AAAAA");
?>
Run Code Online (Sandbox Code Playgroud)
<?php
$string = "<label> AAAAA"; //whatever you want
echo htmlspecialchars($string);
?>
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
29920 次 |
最近记录: |