final public
|
#
__construct(
)
Static class – cannot be instantiated. Static class – cannot be instantiated. |
public static
bool
|
#
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 |
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 |
public static
string
|
#
chr(
int
$code,
string
$encoding = 'UTF-8'
)
Returns a specific character. Returns a specific character. Parameters$code int codepoint$encoding string encoding |
public static
bool
|
#
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 |
public static
bool
|
#
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 |
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 |
public static
string
|
#
toAscii(
string
$s
)
Converts to ASCII. Converts to ASCII. Parameters$s string UTF-8 encodingReturnsstring ASCII
|
public static
string
|
#
webalize(
string
$s,
string
$charlist = NULL,
bool
$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 allowed characters$lower bool |
public static
string
|
#
truncate(
string
$s,
int
$maxLen,
string
$append = '…'
)
Truncates string to maximal length. Truncates string to maximal length. Parameters$s string UTF-8 encoding$maxLen int$append string UTF-8 encoding |
public static
string
|
#
indent(
string
$s,
int
$level = 1,
string
$chars = ' '
)
Indents the content from the left. Indents the content from the left. Parameters$s string UTF-8 encoding or 8-bit$level int$chars string |
public static
string
|
#
lower(
string
$s
)
Convert to lower case. Convert to lower case. Parameters$s string UTF-8 encoding |
public static
string
|
#
upper(
string
$s
)
Convert to upper case. Convert to upper case. Parameters$s string UTF-8 encoding |
public static
string
|
#
capitalize(
string
$s
)
Capitalize string. Capitalize string. Parameters$s string UTF-8 encoding |
public static
bool
|
#
compare(
string
$left,
string
$right,
int
$len = NULL
)
Case-insensitive compares UTF-8 strings. Case-insensitive compares UTF-8 strings. Parameters$left string$right string$len int |
public static
int
|
#
length(
string
$s
)
Returns UTF-8 string length. Returns UTF-8 string length. Parameters$s string |
public static
string
|
#
trim(
string
$s,
string
$charlist = '
' . "\0" . ' '
)
Strips whitespace. Strips whitespace. Parameters$s string UTF-8 encoding$charlist string |
public static
string
|
#
padLeft(
string
$s,
int
$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 int$pad string |
public static
string
|
#
padRight(
string
$s,
int
$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 int$pad string |
public static
array
|
#
split(
string
$subject,
string
$pattern,
int
$flags = 0
)
Splits string by a regular expression. Splits string by a regular expression. Parameters$subject string$pattern string$flags int |
public static
mixed
|
#
match(
string
$subject,
string
$pattern,
int
$flags = 0,
int
$offset = 0
)
Performs a regular expression match. Performs a regular expression match. Parameters$subject string$pattern string$flags int$offset int |
public static
array
|
#
matchAll(
string
$subject,
string
$pattern,
int
$flags = 0,
int
$offset = 0
)
Performs a global regular expression match. Performs a global regular expression match. Parameters$subject string$pattern string$flags int (PREG_SET_ORDER is default)$offset int |
public static
string
|
#
replace(
string
$subject,
string|array
$pattern,
string|callback
$replacement = NULL,
int
$limit = -1
)
Perform a regular expression search and replace. Perform a regular expression search and replace. Parameters$subject string$pattern string|array$replacement string|callback$limit int |