FILTER_SANITIZE_SPECIAL_CHARS常數過濾HTML轉義特殊字元。
FILTER_FLAG_STRIP_LOW − 剝離ASCII值低於32的字元
# FILTER_FLAG_STRIP_HIGH − 剝離ASCII值高於32的字元
##FILTER_FLAG_ENCODE_HIGH − 編碼ASCII值高於32的字元
<?php $var = "Favorite Sports is Football & Cricket?"; var_dump(filter_var($var,FILTER_SANITIZE_SPECIAL_CHARS)); ?>
string(43) "Favorite Sports is Football & Cricket?"
以上是PHP中的FILTER_SANITIZE_SPECIAL_CHARS常數的詳細內容。更多資訊請關注PHP中文網其他相關文章!