PHP code example of yulia633 / trim-string

1. Go to this page and download the library: Download yulia633/trim-string 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/ */

    

yulia633 / trim-string example snippets





$currentString = "Пример очень длинной строки, о которой все писали в новостях, а также
читали в интернет иточниках. Об этом примере очень длинной строки, мы вспомним ни раз,
и не два.";

$trimmed = new TrimString();
$exampleString = $trimmed->trim($currentString, 10, '...');

print_r($exampleString); //Пример очень длинной строки, о которой все писали в ...