str::short($string, $length, $rep = '…')
The string to be shortened
The final number of characters the string should have
The element, which should be added if the string is too long. Ellipsis is the default.
The shortened string
echo str::short('This is a very, very, very long string', 10); // output: This is a… echo str::short('This is a very, very, very long string', 10, '####'); // output: This i####
Is something missing or incorrect? Edit this page on Github…