Documentation

Util
in package

Table of Contents

ASCII_UPPER_A  = 65
ASCII_UPPER_Z  = 90
CASE_CONVERSION_OFFSET  = 32
convertToLowercase()  : mixed
Convert a character in ASCII to lower case.
isDigit()  : mixed
isNumeric()  : bool
Validate a positive numeric string with an optional separator. This method avoids converting the string to another data type as it is more performant not to and also allows validation of ratios and version numbers.
splitString()  : mixed
strEqualsIgnoreCase()  : bool
Case-insensitive string comparrison

Constants

ASCII_UPPER_A

public mixed ASCII_UPPER_A = 65

ASCII_UPPER_Z

public mixed ASCII_UPPER_Z = 90

CASE_CONVERSION_OFFSET

public mixed CASE_CONVERSION_OFFSET = 32

Methods

convertToLowercase()

Convert a character in ASCII to lower case.

public static convertToLowercase( $char) : mixed
Parameters
$char :
Return values
mixed —

isDigit()

public static isDigit(mixed $c) : mixed
Parameters
$c : mixed
Return values
mixed —

isNumeric()

Validate a positive numeric string with an optional separator. This method avoids converting the string to another data type as it is more performant not to and also allows validation of ratios and version numbers.

public static isNumeric( $str,  $separator,  $minSeparatorCount,  $maxSeparatorCount) : bool

Integers: isNumeric("1234", '\0', 0, 0); Floats: isNumeric("12.34", '.', 1, 1); Versions: isNumeric("110.56.67", '.', 0, 2); Ratios: isNumeric("375/812", '/', 1, 1);

Parameters
$str :
$separator :
$minSeparatorCount :
$maxSeparatorCount :
Return values
bool —

splitString()

public static splitString(mixed $stringToSplit, mixed $delimiter[, mixed $limit = PHP_INT_MAX ]) : mixed
Parameters
$stringToSplit : mixed
$delimiter : mixed
$limit : mixed = PHP_INT_MAX
Return values
mixed —

strEqualsIgnoreCase()

Case-insensitive string comparrison

public static strEqualsIgnoreCase(string $var1, string $var2) : bool
Parameters
$var1 : string
$var2 : string
Return values
bool —

Search results