메소드 |
설명 |
|
apostrophe ( string $name ) : string |
Adds an apostrohpe to a string/name if applicable |
|
contains ( string $str, string $needle, boolean $i = true ) : string |
Checks if a str contains another string |
|
cutout ( $str, integer $length, string $rep = '…' ) : string |
Shortens a string by cutting out chars in the middle
This method mimicks the shortening which is used for filenames in the Finder |
|
email ( string $email, string $text = false, string $title = false, string $class = false ) : string |
Creates an encoded email address, including proper html-tags |
|
encode ( string $string ) : string |
Encode a string (used for email addresses) |
|
entities ( ) : array |
An internal store for a html entities translation table |
|
excerpt ( string $string, integer $chars = 140, boolean $removehtml = true, string $rep = '…' ) : string |
Creates an exceprt of a string
It removes all html tags first and then uses str::short |
|
html ( string $string, boolean $keep_html = true ) : string |
Converts a string to a html-safe string |
|
length ( string $str ) : string |
An UTF-8 safe version of strlen() |
|
link ( string $link, string $text = false ) : string |
Creates a link tag |
|
lower ( string $str ) : string |
An UTF-8 safe version of strtolower() |
|
match ( string $string, string $preg, string $get = false, string $placeholder = false ) : mixed |
preg_match sucks! This tries to make it more convenient |
|
parse ( string $string, string $mode = 'json' ) : string |
Parses a string by a set of available methods |
|
plural ( integer $count, string $many, string $one, string $zero = '' ) : string |
A switch to display either one or the other string dependend on a counter |
|
random ( integer $length = false ) : string |
Generates a random string |
|
sanitize ( string $string, string $type = 'str', string $default = null ) : string |
A set of sanitizer methods |
|
short ( string $string, integer $chars, string $rep = '…' ) : string |
Shortens a string and adds an ellipsis if the string is too long |
|
shorturl ( string $url, integer $chars = false, boolean $base = false, string $rep = '…' ) : string |
Shortens an URL
It removes http:// or https:// and uses str::short afterwards |
|
split ( string $string, string $separator = ',', integer $length = 1 ) : array |
Better alternative for explode()
It takes care of removing empty values
and it has a built-in way to skip values
which are too short. |
|
stripslashes ( string $string ) : string |
A better way to strip slashes |
|
substr ( string $str, integer $start, integer $end = null ) : string |
An UTF-8 safe version of substr() |
|
trim ( string $string ) : string |
A more brutal way to trim. |
|
ucfirst ( $str ) : string |
An UTF-8 safe version of ucfirst() |
|
ucwords ( $str ) : string |
An UTF-8 safe version of ucwords() |
|
unhtml ( string $string ) : string |
Removes all html tags and encoded chars from a string |
|
unxml ( string $string ) : string |
Removes all xml entities from a string
and convert them to html entities first
and remove all html entities afterwards. |
|
upper ( string $str ) : string |
An UTF-8 safe version of strotoupper() |
|
urlify ( string $text ) : string |
Convert a string to a safe version to be used in an URL |
|
utf8 ( string $string ) : string |
Converts a string to UTF-8 |
|
xml ( string $text, boolean $html = true ) : string |
Converts a string to a xml-safe string
Converts it to html-safe first and then it
will replace html entities to xml entities |
|