Public Member Functions | |
widont ($str) | |
Prevents widow words by inserting a non-breaking space between the last two words. |
Static Public Member Functions | |
static | limit_words ($str, $limit=100, $end_char=NULL) |
Limits a phrase to a given number of words. | |
static | limit_chars ($str, $limit=100, $end_char=NULL, $preserve_words=FALSE) |
Limits a phrase to a given number of characters. | |
static | alternate () |
Alternates between two or more strings. | |
static | random ($type= 'alnum', $length=8) |
Generates a random string of a given type and length. | |
static | reduce_slashes ($str) |
Reduces multiple slashes in a string to single slashes. | |
static | censor ($str, $badwords, $replacement= '#', $replace_partial_words=FALSE) |
Replaces the given words with a string. | |
static | bytes ($bytes, $force_unit=NULL, $format=NULL, $si=TRUE) |
Returns human readable sizes. | |
static | cs_win2ascii ($s) |
static | cs_iso2ascii ($s) |
static | cs_utf2ascii ($s) |
static | phone_number ($number, $country_code) |
Prints phone number in pretty format. | |
static | starts_with ($str, $start) |
Check if first string starts with second. | |
static | ends_with ($str, $end) |
Check if first string ends with second. | |
static | object_format ($object, $format) |
Pushes object properties into given format string. | |
static | print_in_columns ($data, $columns) |
Prints data in columns seperated by tabulator. | |
static | not_null ($item, $print=FALSE, $replace= '???', $extra_text= '') |
Handle printing of empty inputs. | |
static | highligth ($what, $where) |
Highlight occurences of what in where by span with class highlighted. |
Public Attributes | |
const | TAB = "\t" |
const | EOL = "\n" |
|
static |
Alternates between two or more strings.
string | strings to alternate between |
|
static |
Returns human readable sizes.
integer | size in bytes |
string | a definitive unit |
string | the return string format |
boolean | whether to use SI prefixes or IEC |
|
static |
Replaces the given words with a string.
string | phrase to replace words in |
array | words to replace |
string | replacement string |
boolean | replace words across word boundries (space, period, etc) |
|
static |
Check if first string ends with second.
string | $str | String |
string | $end | End |
|
static |
Highlight occurences of what in where by span with class highlighted.
string | $what | What should be highlighted |
string | $where | Where it should be highlighted |
|
static |
Limits a phrase to a given number of characters.
string | phrase to limit characters of |
integer | number of characters to limit to |
string | end character or entity |
boolean | enable or disable the preservation of words while limiting |
|
static |
Limits a phrase to a given number of words.
string | phrase to limit words of |
integer | number of words to limit to |
string | end character or entity |
|
static |
Handle printing of empty inputs.
string | $item | |
boolean | ||
string | $replace | |
string | $extra_text |
|
static |
Pushes object properties into given format string.
string | $object | Object to push into format |
string | $format | Format of ouput with tag in shape: {property} |
|
static |
Prints phone number in pretty format.
string | $number | |
string | $country_code |
|
static |
Prints data in columns seperated by tabulator.
array | $data | |
array | $columns |
|
static |
Generates a random string of a given type and length.
string | a type of pool, or a string of characters to use as the pool |
integer | length of string to return |
unique - 40 character unique hash alnum - alpha-numeric characters alpha - alphabetical characters numeric - digit characters, 0-9 nozero - digit characters, 1-9
|
static |
Reduces multiple slashes in a string to single slashes.
string | string to reduce slashes of |
|
static |
Check if first string starts with second.
string | $str | String |
string | $start | Start |
text::widont | ( | $str | ) |
Prevents widow words by inserting a non-breaking space between the last two words.
string | string to remove widows from |