Methods summary
final public
|
#
__construct( )
Static class - cannot be instantiated.
Static class - cannot be instantiated.
|
public static
boolean
|
#
checkEncoding( string $s, string $encoding = 'UTF-8' )
Checks if the string is valid for the specified encoding.
Checks if the string is valid for the specified encoding.
Parameters
- $s
string byte stream to check
- $encoding
string expected encoding
Returns
boolean
|
public static
string
|
#
fixEncoding( string $s, string $encoding = 'UTF-8' )
Returns correctly encoded string.
Returns correctly encoded string.
Parameters
- $s
string byte stream to fix
- $encoding
string encoding
Returns
string
|
public static
string
|
#
chr( integer $code, string $encoding = 'UTF-8' )
Returns a specific character.
Returns a specific character.
Parameters
- $code
integer codepoint
- $encoding
string encoding
Returns
string
|
public static
boolean
|
#
startsWith( string $haystack, string $needle )
Starts the $haystack string with the prefix $needle?
Starts the $haystack string with the prefix $needle?
Parameters
- $haystack
string
- $needle
string
Returns
boolean
|
public static
boolean
|
#
endsWith( string $haystack, string $needle )
Ends the $haystack string with the suffix $needle?
Ends the $haystack string with the suffix $needle?
Parameters
- $haystack
string
- $needle
string
Returns
boolean
|
public static
string
|
#
normalize( string $s )
Removes special controls characters and normalizes line endings and
spaces.
Removes special controls characters and normalizes line endings and
spaces.
Parameters
- $s
string UTF-8 encoding or 8-bit
Returns
string
|
public static
string
|
#
webalize( string $s, string $charlist = NULL, boolean $lower = TRUE )
Converts to web safe characters [a-z0-9-] text.
Converts to web safe characters [a-z0-9-] text.
Parameters
- $s
string UTF-8 encoding
- $charlist
string ASCII
- $lower
boolean
Returns
string
|
public static
string
|
#
truncate( string $s, integer $maxLen, string $append = "\xE2\x80\xA6" )
Truncates string to maximal length.
Truncates string to maximal length.
Parameters
- $s
string UTF-8 encoding
- $maxLen
integer
- $append
string UTF-8 encoding
Returns
string
|
public static
string
|
#
indent( string $s, integer $level = 1, string $chars = "\t" )
Indents the content from the left.
Indents the content from the left.
Parameters
- $s
string UTF-8 encoding or 8-bit
- $level
integer
- $chars
string
Returns
string
|
public static
string
|
#
lower( string $s )
Convert to lower case.
Parameters
Returns
string
|
public static
string
|
#
upper( string $s )
Convert to upper case.
Parameters
Returns
string
|
public static
string
|
#
capitalize( string $s )
Capitalize string.
Parameters
Returns
string
|
public static
string
|
#
trim( string $s, string $charlist = " \t\n\r\0\x0B\xC2\xA0" )
Strips whitespace.
Parameters
- $s
string UTF-8 encoding
- $charlist
string
Returns
string
|
public static
string
|
#
padLeft( string $s, integer $length, string $pad = ' ' )
Pad a string to a certain length with another string.
Pad a string to a certain length with another string.
Parameters
- $s
string UTF-8 encoding
- $length
integer
- $pad
string
Returns
string
|
public static
string
|
#
padRight( string $s, integer $length, string $pad = ' ' )
Pad a string to a certain length with another string.
Pad a string to a certain length with another string.
Parameters
- $s
string UTF-8 encoding
- $length
integer
- $pad
string
Returns
string
|