Class Format
Format validation statics
Methods summary
public static boolean | #isJSON(mixed$data) Checks whether the data is valid JSON Checks whether the data is valid JSON Parameters- $data
mixed $data The data to check
Returnsboolean
Author |
public static boolean | #isIpv4(string$input) Checks if the supplied string is a valid IPv4 IP Checks if the supplied string is a valid IPv4 IP Parameters- $input
string $input The input
Returnsboolean
Author |
public static string | #scalarOutput(mixed$input,integer$prettifyMethod=Alo\Statics\Format::M_PRINT_R ) Makes output scalar. If $input is already scalar, simply returns it; otherwise uses a function specified in $prettifyMethod to make the output scalar Makes output scalar. If $input is already scalar, simply returns it; otherwise uses a function specified in $prettifyMethod to make the output scalar Parameters- $input
mixed $input The input to scalarise- $prettifyMethod
integer $prettifyMethod Function to use to make output scalar if $input isn't already scalar. See class M_* constants.
Returnsstring
|
public static integer|float|mixed | #makeNumeric(mixed$var,boolean$boolMode=false) Typecasts a variable to float or int if it's numeric Typecasts a variable to float or int if it's numeric Parameters- $var
mixed $var The variable- $boolMode
boolean $boolMode Whether we're checking for boolean mode FULLTEXT search values
Returnsinteger|float|mixed
Author |
Magic methods summary
Constants summary
integer | M_SERIALIZE | 0 | #Defines an method as "serialize" Defines an method as "serialize" |
integer | M_JSON | 1 | #Defines a method as "json_encode" Defines a method as "json_encode" |
integer | M_PRINT_R | 2 | #Defines a method as "print_r" Defines a method as "print_r" |