Class: str
A set of handy string methods
Methods
-
str::apostrophe
Adds an apostrohpe to a string/name if applicable
-
str::contains
Checks if a str contains another string
-
str::cutout
Shortens a string by cutting out chars in the middle
This method mimicks the shortening which is used for filenames in the Finder -
str::email
Creates an encoded email address, including proper html-tags
-
str::encode
Encode a string (used for email addresses)
-
str::entities
An internal store for a html entities translation table
-
str::excerpt
Creates an exceprt of a string
It removes all html tags first and then uses str::short -
str::html
Converts a string to a html-safe string
-
str::length
An UTF-8 safe version of strlen()
-
str::link
Creates a link tag
-
str::lower
An UTF-8 safe version of strtolower()
-
str::match
preg_match sucks! This tries to make it more convenient
-
str::parse
Parses a string by a set of available methods
-
str::plural
A switch to display either one or the other string dependend on a counter
-
str::random
Generates a random string
-
str::sanitize
A set of sanitizer methods
-
str::short
Shortens a string and adds an ellipsis if the string is too long
-
str::shorturl
Shortens an URL
It removes http:// or https:// and uses str::short afterwards -
str::split
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. -
str::stripslashes
A better way to strip slashes
-
str::substr
An UTF-8 safe version of substr()
-
str::trim
A more brutal way to trim.
-
str::ucfirst
An UTF-8 safe version of ucfirst()
-
str::ucwords
An UTF-8 safe version of ucwords()
-
str::unhtml
Removes all html tags and encoded chars from a string
-
str::unxml
Removes all xml entities from a string
-
str::upper
An UTF-8 safe version of strotoupper()
-
str::urlify
Convert a string to a safe version to be used in an URL
-
str::utf8
Converts a string to UTF-8
-
str::xml
Converts a string to a xml-safe string
Converts it to html-safe first and then it
will replace html entities to xml entities