PHP code example of flextype-components / text

1. Go to this page and download the library: Download flextype-components/text library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

flextype-components / text example snippets


use Flextype\Component\Text\Text;

echo Text::translitIt('Привет');

echo Text::trimSlashes('some text here/');

echo Text::reduceSlashes('some//text//here');

echo Text::stripQuotes('some "text" here');

echo Text::quotesToEntities('some "text" here');

echo Text::random();

$str = Text::increment($str);

echo Text::cut('Some text here', 5);

echo Text::lowercase('Some text here');

echo Text::uppercase('some text here');

echo Text::length('Some text here');

echo Text::lorem(2);

echo Text::right('Some text here', 4);

echo Text::left('Some text here', 4);

echo Text::nl2br("Some \n text \n here");

echo Text::br2nl("Some <br /> text <br /> here");

echo Text::ampEncode("M&CMS");

echo Text::ampDecode("M&amp;CMS");

echo Text::toHtml('test');

$safe_string = Text::safeString('hello world');

$encrypt_string = Text::encryptString('password', 'string_salt');