webCOMAND

io_comand_util\string_util

Analyze and manipulate text strings.

Example

use \io_comand_util\string_util;

// output: Some values: 4 KB, 2 KB…
$values = [4096, 2048, 3072];
$csv = '';
foreach($values as $value) {
    $value = string_util::format_bytes($value);
    $text = string_util::append_string($csv, ', ', $value);
}
echo(string_util::ellipsize('Some values: ' . $csv, 24));