public static
integer
|
#
size( string $string )
Returns the string size in bytes.
Returns the string size in bytes.
Parameters
Returns
integer Size in bytes
|
|
public static
string
|
#
normalizeEncoding( string $string )
Normalizes the encoding of a string (UTF8 NFD to NFC).
Normalizes the encoding of a string (UTF8 NFD to NFC).
On HFS+ filesystem (OS X) filenames are stored in UTF8 NFD while all other
filesystems are using UTF8 NFC. NFC is more common in general.
Parameters
Returns
string string
|
|
public static
string
|
#
normalize( string $string, string $replaceChar = '_', string $allowedChars = '' )
Normalizes a string.
Makes the string lowercase, replaces umlauts by their ascii representation
(รค -> ae etc.), and replaces all other chars that do not match a-z, 0-9 or
$allowedChars by $replaceChar.
Parameters
- $string
- Input string
- $replaceChar
- Character that is used to replace not allowed chars
- $allowedChars
- Character whitelist
Returns
string string
|
|
public static
array
|
#
split( string $string )
Splits a string by spaces (Strings with quotes will be regarded).
Splits a string by spaces (Strings with quotes will be regarded).
Examples: "a b 'c d'" -> array('a', 'b', 'c d') "a=1 b='c d'" ->
array('a' => 1, 'b' => 'c d')
Parameters
Returns
array array
|
|
public static
array
|
#
versionSplit( string $version )
Splits a version string.
Parameters
Returns
array Version parts
|
|
public static
integer|boolean
|
#
versionCompare( string $version1, string $version2, string $comparator = null )
Compares two version number strings.
Compares two version number strings.
In contrast to version_compare() it treats "1.0" and "1.0.0" as equal and it
supports a space as separator for the version parts, e.g. "1.0 beta1"
Parameters
- $version1
- First version number
- $version2
- Second version number
- $comparator
- Optional comparator
Returns
integer|boolean int|bool
See
|
|
public static
string
|
#
yamlEncode( array $value, integer $inline = 3 )
Returns a string containing the YAML representation of $value.
Returns a string containing the YAML representation of $value.
Parameters
- $value
- The value being encoded
- $inline
- The level where you switch to inline YAML
Returns
string string
|
|
public static
array
|
#
yamlDecode( string $value )
Parses YAML into a PHP array.
Parses YAML into a PHP array.
Parameters
Returns
array array
Throws
|
|
public static
string
|
#
buildQuery( array $params, string $argSeparator = '&' )
Generates URL-encoded query string.
Generates URL-encoded query string.
Parameters
Returns
string string
|
|
public static
string
|
#
buildAttributes( array $attributes )
Returns a string by key="value" pair.
Returns a string by key="value" pair.
Parameters
Returns
string string
|
|
public static
string
|
#
highlight( string $string )
Highlights a string.
Parameters
Returns
string string
|
|