2017-03-12 68 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