名稱 | 功用 |
FILTER\_CALLBACK | option可以讓開發者用自訂的function處理 |
FILTER\_SANITIZE\_STRING | 去除標籤或特殊字元(html標籤會直接被消除) |
FILTER\_SANITIZE\_ENCODED | 與urlencode()相同,過濾特殊字串 |
FILTER\_SANITIZE\_MAGIC\_QUOTES | 過濾針對SQL injection做過濾(例如單、雙引號) |
FILTER\_SANITIZE\_SPECIAL\_CHARS | 針對HTML做encoding,例如<會轉成< |
FILTER\_SANITIZE\_EMAIL | 過濾e-mail,刪除e-mail格式不該出現的字元(除了$-\_.+!\*'{}|^~\[\]`#%/?@&=和數字),例如a(b)@gmail.com會被過濾成ab@gmail.com |
FILTER\_SANITIZE\_URL | 過濾URL,刪除URL格式不該出現的字元 |
FILTER\_SANITIZE\_NUMBER\_INT | 刪除所有字元,只留下數字與+-符號 |
FILTER\_SANITIZE\_NUMBER\_FLOAT | 刪除所有字元,只留下數字和+-.,eE |
FILTER\_VALIDATE\_INT | 判斷數字是否有在範圍內 |
FILTER\_VALIDATE\_BOOLEAN | 判斷布林值,1、true、on、yes都會判斷成true,反之為false,若是這些以外的值會回傳NULL |
FILTER\_VALIDATE\_FLOAT | 判斷是否為浮點數 |
FILTER\_VALIDATE\_REGEXP | 利用regexp做驗證 |
FILTER\_VALIDATE\_URL | URL驗證 |
FILTER\_VALIDATE\_EMAIL | e-mail驗證 |
FILTER\_VALIDATE\_IP | IP驗證 |