php html encode
//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);
?>
页:
[1]