key()
key(string $key) : string
Sanitizes a string key.
Parameters
string | $key | String key |
Returns
string —Sanitized key
string(string $string, string $fallback_string = '', string $context = 'save') : string
Sanitizes a string, or returns a fallback string.
Specifically, HTML and PHP tags are stripped. Further actions can be added via the plugin API. If $string is empty and $fallback_string is set, the latter will be used.
string | $string | The string to be sanitized. |
string | $fallback_string | Optional. A string to use if $string is empty. |
string | $context | Optional. The operation for which the string is sanitized |
The sanitized string.
username(string $username, boolean $strict = false) : string
Sanitizes a username, stripping out unsafe characters.
string | $username | The username to be sanitized. |
boolean | $strict | If set, limits $username to specific characters. Default false. |
Sanitized username.