//php对html进行编码,比如留言板,保存留言内容时最好对其进行编码,保证安全。
<?php
$str = "A 'quote' is <b>bold</b>";
// Outputs: A 'quote' is <b>bold</b>
echo htmlentities($str);
// Outputs: A 'quote' is <b>bold</b>
echo htmlentities($str, ENT_QUOTES);
?>
php html encode
最新推荐文章于 2021-03-13 02:07:08 发布