The optional second argument, quote_style, tells the function what to do with single and double quote characters. The default mode, ENT_COMPAT, is the backwards compatible mode which only translates the double-quote character and leaves the single-quote untranslated. If ENT_QUOTES is set, both single and double quotes are translated and if ENT_NOQUOTES is set neither single nor double quotes are translated.
第二个可选参数"引用模式"告诉函数如何处理单引号和双引号。
默认的模式下是"ENT_COMPAT",只处理双引号,,如果设置为"ENT_QUOTES"模式,单双引号全部处理,而"ENT_NOQUOTES"全部不与处理~
最新回复
第二个可选参数"引用模式"告诉函数如何处理单引号和双引号。
默认的模式下是"ENT_COMPAT",只处理双引号,,如果设置为"ENT_QUOTES"模式,单双引号全部处理,而"ENT_NOQUOTES"全部不与处理~
$aa=htmlspecialchars("<script>alert('信息内容');</script>",ENT_QUOTES);//编码html写入数据库
echo (stripslashes(htmlspecialchars_decode($aa)));//读出数据并解码html并取消斜线 ?>
网页中还是会弹出对话框,怎么处理呢