\Alo\StaticsFormat

Format validation statics

Summary

Methods
Properties
Constants
isJSON()
scalarOutput()
makeNumeric()
isBoolean()
No public properties found
M_SERIALIZE
M_JSON
M_PRINT_R
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Constants

M_SERIALIZE

M_SERIALIZE

Defines an method as "serialize"

M_JSON

M_JSON

Defines a method as "json_encode"

M_PRINT_R

M_PRINT_R

Defines a method as "print_r"

Methods

isJSON()

isJSON(mixed  $data) : boolean

Checks whether the data is valid JSON

Parameters

mixed $data

The data to check

Returns

boolean

scalarOutput()

scalarOutput(mixed  $input, integer  $prettify_method = self::M_PRINT_R) : string

Makes output scalar. If $input is already scalar, simply returns it; otherwise uses a function specified in $prettify_method to make the output scalar

Parameters

mixed $input

The input to scalarise

integer $prettify_method

Function to use to make output scalar if $input isn't already scalar. See class M_* constants.

Returns

string

makeNumeric()

makeNumeric(mixed  $var, boolean  $boolMode = false) : integer|float|mixed

Typecasts a variable to float or int if it's numeric

Parameters

mixed $var

The variable

boolean $boolMode

Whether we're checking for boolean mode FULLTEXT search values

Returns

integer|float|mixed

isBoolean()

isBoolean(string|integer  $var) : boolean

Checks if a variable is of type boolean or is implied to be boolean

Parameters

string|integer $var

Returns

boolean