FILTER_SANITIZE_SPECIAL_CHARS常量过滤器HTML会转义特殊字符。
FILTER_FLAG_STRIP_LOW-去除ASCII值低于32的字符
FILTER_FLAG_STRIP_HIGH-去除ASCII值大于32的字符
FILTER_FLAG_ENCODE_HIGH -ASCII值大于32的字符编码
FILTER_SANITIZE_SPECIAL_CHARS常量没有任何内容。
<?php $var = "Favorite Sports is Football & Cricket?"; var_dump(filter_var($var,FILTER_SANITIZE_SPECIAL_CHARS)); ?>
输出结果
以下是输出。
string(43) "Favorite Sports is Football & Cricket?"