我如何使這個實際顯示在PHP中?如何在PHP中顯示htmlspecialchars
$answer=<script>alert(It converts to HTML.)</script>
echo "The function is: htmlspecialchars ($answer)."
我如何使這個實際顯示在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