如何在PHP中显示htmlspecialchars
我如何使这个实际显示在PHP中?如何在PHP中显示htmlspecialchars
$answer=<script>alert(It converts to HTML.)</script>
echo "The function is: htmlspecialchars ($answer)."
与您的问题相比更具克莱尔特色。你想用这个脚本怎么样?和什么是你的问题在PHP?
$answer = "<script>alert(It converts to HTML.)</script>"
echo "The function is: htmlspecialchars (". $answer .")." //something like this? or htmlspecialchars is a php function?
我想让它显示我在网页上的问题上输入的具体内容 – javalavamama
htmlspecialchars是php的一个函数吗? 检查我的编辑 –
$answer = "<script>alert(It converts to HTML.)</script>"
echo "The function is: htmlspecialchars".$answer;
$variable = <<<'EOS'
$answer=<script>alert(It converts to HTML.)</script>
echo "The function is: htmlspecialchars ($answer)."
EOS;
echo htmlspecialchars($variable);
这将准确显示你输入的信息。
这工作谢谢你! – javalavamama
这是你的确切代码吗? – apokryfos
我试图在页面上显示那个 – javalavamama
您的预期输出是什么? – C2486