Methods summary
public static
string
|
#
escapeHtml( mixed $s, integer $quotes = ENT_QUOTES )
Escapes string for use inside HTML template.
Escapes string for use inside HTML template.
Parameters
- $s
mixed UTF-8 encoding
- $quotes
integer optional attribute quotes
Returns
string
|
public static
string
|
#
escapeXML( string $s )
Escapes string for use inside XML 1.0 template.
Escapes string for use inside XML 1.0 template.
Parameters
Returns
string
|
public static
string
|
#
escapeCss( string $s )
Escapes string for use inside CSS template.
Escapes string for use inside CSS template.
Parameters
Returns
string
|
public static
string
|
#
escapeJs( mixed $s )
Escapes variables for use inside <script>.
Escapes variables for use inside <script>.
Parameters
Returns
string
|
public static
string
|
#
escapeICal( mixed $s )
Escapes string for use inside iCal template.
Escapes string for use inside iCal template.
Parameters
Returns
string
|
public static
string
|
#
safeUrl( string $s )
Sanitizes string for use inside href attribute.
Sanitizes string for use inside href attribute.
Parameters
Returns
string
|
public static
string
|
#
strip( string $s )
Replaces all repeated white spaces with a single space.
Replaces all repeated white spaces with a single space.
Parameters
- $s
string UTF-8 encoding or 8-bit
Returns
string
|
public static
string
|
#
indent( string $s, integer $level = 1, string $chars = "\t" )
Indents the HTML content from the left.
Indents the HTML content from the left.
Parameters
- $s
string UTF-8 encoding or 8-bit
- $level
integer
- $chars
string
Returns
string
|
public static
string
|
|
public static
string
|
#
bytes( integer $bytes, integer $precision = 2 )
Converts to human readable file size.
Converts to human readable file size.
Parameters
- $bytes
integer
- $precision
integer
Returns
string
|
public static
string
|
#
replace( string $subject, string $search, string $replacement = '' )
Performs a search and replace.
Performs a search and replace.
Parameters
- $subject
string
- $search
string
- $replacement
string
Returns
string
|
public static
string
|
#
replaceRe( string $subject, string $pattern, $replacement = '' )
Perform a regular expression search and replace.
Perform a regular expression search and replace.
Parameters
- $subject
string
- $pattern
string
- $replacement
Returns
string
|
public static
string
|
#
dataStream( string $data, string $type = NULL )
The data: URI generator.
Parameters
- $data
string
- $type
string
Returns
string
|
public static
string
|
#
nl2br( string $value )
Parameters
Returns
string
|
public static
string
|
#
substring( string $s, integer $start, integer $length = NULL )
Returns a part of UTF-8 string.
Returns a part of UTF-8 string.
Parameters
- $s
string
- $start
integer
- $length
integer
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
|
#
lower( $s )
Convert to lower case.
Returns
string
|
public static
string
|
#
upper( $s )
Convert to upper case.
Returns
string
|
public static
string
|
#
firstUpper( $s )
Convert first character to upper case.
Convert first character to upper case.
Returns
string
|
public static
string
|
|
public static
integer
|
#
length( $s )
Returns UTF-8 string length.
Returns UTF-8 string length.
Returns
integer
|
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
|
#
htmlAttributes( $attrs )
Returns element's attributes.
Returns element's attributes.
Returns
string
|