jFilter
in package
utility class to check values.
Tags
Table of Contents
- BAD_SAVE_HTML = 2
- INVALID_HTML = 1
- cleanHtml() : string
- remove all javascript things in a html content The html content should be a subtree of a body tag, not a whole document.
- isBool() : bool
- check if the given value is a boolean.
- isEmail() : bool
- check if the given value is an email.
- isFloat() : bool
- check if the given value is a float.
- isHexInt() : bool
- check if the given value is an hexadecimal integer.
- isInt() : bool
- check if the given value is an integer.
- isIPv4() : bool
- check if the given value is an IP version 4.
- isIPv6() : bool
- check if the given value is an IP version 6.
- isUrl() : bool
- check if the given value is.
- usePhpFilter() : mixed
- cleanAttr() : mixed
- _construct() : mixed
Constants
BAD_SAVE_HTML
public
mixed
BAD_SAVE_HTML
= 2
Tags
INVALID_HTML
public
mixed
INVALID_HTML
= 1
Tags
Methods
cleanHtml()
remove all javascript things in a html content The html content should be a subtree of a body tag, not a whole document.
public
static cleanHtml(string $html[, mixed $isXhtml = false ]) : string
Parameters
- $html : string
-
html content
- $isXhtml : mixed = false
Tags
Return values
string —the cleaned html content
isBool()
check if the given value is a boolean.
public
static isBool(string $val) : bool
Parameters
- $val : string
-
the value
Tags
Return values
bool —true if it is valid
isEmail()
check if the given value is an email.
public
static isEmail(string $val) : bool
Parameters
- $val : string
-
the value
Tags
Return values
bool —true if it is valid
isFloat()
check if the given value is a float.
public
static isFloat(string $val[, int $min = null ][, int $max = null ]) : bool
Parameters
- $val : string
-
the value
- $min : int = null
-
minimum value (optional), null if no minimum
- $max : int = null
-
maximum value (optional), null if no maximum
Tags
Return values
bool —true if it is valid
isHexInt()
check if the given value is an hexadecimal integer.
public
static isHexInt(string $val[, int $min = null ][, int $max = null ]) : bool
Parameters
- $val : string
-
the value
- $min : int = null
-
minimum value (optional), null if no minimum
- $max : int = null
-
maximum value (optional), null if no maximum
Tags
Return values
bool —true if it is valid
isInt()
check if the given value is an integer.
public
static isInt(string $val[, int $min = null ][, int $max = null ]) : bool
Parameters
- $val : string
-
the value
- $min : int = null
-
minimum value (optional), null if no minimum
- $max : int = null
-
maximum value (optional), null if no maximum
Tags
Return values
bool —true if it is valid
isIPv4()
check if the given value is an IP version 4.
public
static isIPv4(string $val) : bool
Parameters
- $val : string
-
the value
Tags
Return values
bool —true if it is valid
isIPv6()
check if the given value is an IP version 6.
public
static isIPv6(string $val) : bool
Parameters
- $val : string
-
the value
Tags
Return values
bool —true if it is valid
isUrl()
check if the given value is.
public
static isUrl(string $url[, mixed $schemeRequired = false ][, mixed $hostRequired = false ][, mixed $pathRequired = false ][, mixed $queryRequired = false ]) : bool
Parameters
- $url : string
-
the url
- $schemeRequired : mixed = false
- $hostRequired : mixed = false
- $pathRequired : mixed = false
- $queryRequired : mixed = false
Tags
Return values
bool —true if it is valid
usePhpFilter()
public
static usePhpFilter() : mixed
Tags
Return values
mixed —cleanAttr()
protected
static cleanAttr(mixed $node) : mixed
Parameters
- $node : mixed
Tags
Return values
mixed —_construct()
private
_construct() : mixed