The filter extension defines 3 types of filters, validation, sanitization, and callback. Additionally, there are a number of flags that change the way these filters are applied.
Constant | Name | Options | Flags | Description |
---|---|---|---|---|
|
|
|
|
Validates value as being boolean-like. - Returns If the option |
|
|
|
Validates value as an e-mail. |
|
|
|
|
|
Validates value as floating point number. |
|
|
|
|
Validates value as integer number, optionally from the specified range. Defaults to allowing only decimal numbers, but may optionally allow octal and hex numbers. |
|
|
|
|
Validates value as IP address, optionally only IPv4 or IPv6, and can disallow private or reserved ranges. |
|
|
|
Validates value against a specified |
|
|
|
|
|
Validates value as a URL (according to RFC2396), optionally require a path, or query string. |
Constant | Name | Flags | Description |
---|---|---|---|
|
|
Remove all characters except letters digits and the special characters: |
|
|
|
|
URL encode string, optionally strip or encode special characters. |
|
|
Apply |
|
|
|
|
Remove all characters except digits, plus and minus sign and optionally |
|
|
Remove all characters except digits, plus and minus sign. |
|
|
|
|
HTML-escape |
|
|
|
The same as calling |
|
|
|
Strip tags, optionally strip or encode special characters. |
|
|
Alias of |
|
|
|
Remove all characters except letters, digits and |
|
|
|
|
Do nothing, optionally strip or encode special characters. Used to access original data when using a default filter. |
Constant | Used with | Description |
---|---|---|
|
|
Strips characters with a numerical value < 32. |
|
|
Strips characters with a numerical value > 127. |
|
|
Allows a period ( |
|
|
Allows a comma ( |
|
|
Allows an |
|
|
Do not encode single ( |
|
|
Encodes all characters with a numerical value < 32. |
|
|
Encodes all characters with a numerical value > 127. |
|
|
Encodes ampersands ( |
|
|
Returns |
|
|
Allows inputs starting with a zero ( |
|
|
Allows inputs starting with |
|
|
Allows IPv4 addresses |
|
|
Allows IPv6 addresses. |
|
|
Disallows the following private IPv4 ranges: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. Disallows IPv6 addresses starting with FD or FC. |
|
|
Disallows the following reserved IPv4 ranges: 0.0.0.0/8, 169.254.0.0/16, 192.0.2.0/24, and 224.0.0.0/4. This flag does not apply to IPv6 addresses. |
|
|
Requires that the URL contains a path part. |
|
|
Requires that the URL contains a query string. |
18.223.106.232