Class: \Flextype\Component\Text\Text

Visibility Function
public static ampDecode(\string $str) : string
Converts & to &. echo Text::ampEncode("M&CMS");
public static ampEncode(\string $str) : string
Converts & to &. echo Text::ampEncode("M&CMS");
public static br2nl(\string $str) : string
with newline. echo Text::br2nl("Some
public static cut(\string $str, int/\integer $length, \string $cut_msg=null) : string
Cut string echo Text::cut('Some text here', 5);
public static encryptPassword(string $str, string $str_salt='string_salt') : string
Encrypt string $encrypt_string = Text::encryptString('password', 'string_salt');
public static increment(\string $str, \integer $first=1, \string $separator='_') : string
Add's _1 to a string or increment the ending number to allow _2, _3, etc $str = Text::increment($str);
public static left(\string $str, int/\integer $num) : string
Extract the first $num characters from a string. echo Text::left('Some text here', 4);
public static length(\string $str) : string
Get length echo Text::length('Some text here');
public static lorem(\integer $num=1) : string
Create a lorem ipsum text echo Text::lorem(2);
public static lowercase(\string $str) : string
Lowercase echo Text::lowercase('Some text here');
public static nl2br(\string $str, \boolean $xhtml=true) : string
Replaces newline with
. echo Text::nl2br("Some \n text \n here");
public static quotesToEntities(\string $str) : string
Convert single and double quotes to entities echo Text::quotesToEntities('some "text" here');
public static random(\string $type='alnum', \integer $length=16) : string
Creates a random string of characters echo Text::random();
public static reduceSlashes(\string $str) : string
Reduces multiple slashes in a string to single slashes. echo Text::reduceSlashes('some//text//here');
public static right(\string $str, int/\integer $num) : string
Extract the last $num characters from a string. echo Text::right('Some text here', 4);
public static safeString(\string $str, \string $delimiter='-', \boolean $lowercase=false) : string
Create safe string. Use to create safe usernames or filenames. $safe_string = Text::safeString('hello world');
public static stripQuotes(\string $str) : string
Removes single and double quotes from a string echo Text::stripQuotes('some "text" here');
public static toHtml(\string $str) : string
Convert plain text to html echo Text::toHtml('test');
public static translitIt(\string $str) : string $str
Translit function to convert text from one script to another. echo Text::translitIt('Привет');
public static trimSlashes(\string $str) : string
Removes any leading and traling slashes from a string echo Text::trimSlashes('some text here/');
public static uppercase(\string $str) : string
Uppercase echo Text::uppercase('some text here');
Language: en, ru