char

php\lib\char

Char Utils for working with unicode chars (using string[0] char)

Class char

Methods


__construct()

private

static of($code)
Parameters:
  • $codeint
Returns:

string

static ord($char)
Parameters:
  • $charstring
Returns:

int

static count($code)

Determines the number of {@code char} values needed to represent the specified character (Unicode code point). If the specified character is equal to or greater than 0x10000, then the method returns 2. Otherwise, the method returns 1.

Parameters:
  • $codeint
Returns:

int

static compare($char1, $char2)
Parameters:
  • $char1string
  • $char2string
Returns:

int

static lower($char)
Parameters:
  • $charstring
Returns:

string

static upper($char)
Parameters:
  • $charstring
Returns:

string

static title($char)
Parameters:
  • $charstring
Returns:

string

static isSpace($char)
Parameters:
  • $charstring
Returns:

bool

static isDigit($char)
Parameters:
  • $charstring
Returns:

bool

static isLetter($char)
Parameters:
  • $charstring
Returns:

bool

static isLetterOrDigit($char)
Parameters:
  • $charstring
Returns:

bool

static isLower($char)
Parameters:
  • $charstring
Returns:

bool

static isUpper($char)
Parameters:
  • $charstring
Returns:

bool

static isTitle($char)
Parameters:
  • $charstring
Returns:

bool

static isWhitespace($char)
Parameters:
  • $charstring
Returns:

bool

static isISOControl($char)
Parameters:
  • $charstring
Returns:

bool

static isDefined($char)

Determines if a character is defined in Unicode.

Parameters:
  • $charstring
Returns:

bool

static isMirrored($char)

Determines whether the specified character (Unicode code point) is mirrored according to the Unicode specification. Mirrored characters should have their glyphs horizontally mirrored when displayed in text that is right-to-left.

Parameters:
  • $charstring
Returns:

bool

static isLowSurrogate($char)

Determines if the given $char value is a <a href=”http://www.unicode.org/glossary/#low_surrogate_code_unit“> Unicode low-surrogate code unit</a> (also known as <i>trailing-surrogate code unit</i>).

Parameters:
  • $charstring
Returns:

bool

static isHighSurrogate($char)

Determines if the given $char value is a <a href=”http://www.unicode.org/glossary/#high_surrogate_code_unit“> Unicode high-surrogate code unit</a> (also known as <i>leading-surrogate code unit</i>).

Parameters:
  • $charstring
Returns:

bool

static isPrintable($char)
Parameters:
  • $charstring
Returns:

bool

static number($char)

Returns the {@code int} value that the specified Unicode character represents.

Parameters:
  • $charstring
Returns:

int