1. Go to this page and download the library: Download pawelzny/trimmer 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/ */
pawelzny / trimmer example snippets
<?PHP
use Trimmer\Trim;
$string = "Far far away, behind the word mountains,
far from the countries Vokalia and Consonantia, there live
the blind texts. Separated they live in Bookmarksgrove right
at the coast of the Semantics, a large language ocean.";
$trim = Trim::chars($string, $length=40);
echo $trim->trim(); // Far far away, behind the word mountai...
<?PHP
use Trimmer\Trim;
$string = "Far far away, behind the word mountains,
far from the countries Vokalia and Consonantia, there live
the blind texts. Separated they live in Bookmarksgrove right
at the coast of the Semantics, a large language ocean.";
$trim = Trim::words($string, $length=40);
echo $trim->trim(); // Far far away, behind the word...