2017-03-12 67 views

回答

0

与您的问题相比更具克莱尔特色。你想用这个脚本怎么样?和什么是你的问题在PHP?

$answer = "<script>alert(It converts to HTML.)</script>" 
echo "The function is: htmlspecialchars (". $answer .")." //something like this? or htmlspecialchars is a php function? 
+0

我想让它显示我在网页上的问题上输入的具体内容 – javalavamama

+0

htmlspecialchars是php的一个函数吗? 检查我的编辑 –

0

$answer = "<script>alert(It converts to HTML.)</script>"

echo "The function is: htmlspecialchars".$answer;

0
$variable = <<<'EOS' 
$answer=<script>alert(It converts to HTML.)</script> 
echo "The function is: htmlspecialchars ($answer)." 
EOS; 
echo htmlspecialchars($variable); 

这将准确显示你输入的信息。

+0

这工作谢谢你! – javalavamama