mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-03 09:54:27 +02:00
*** empty log message ***
This commit is contained in:
@@ -86,6 +86,9 @@ function smarty_mod_escape($string, $esc_type = 'html')
|
||||
\*======================================================================*/
|
||||
function smarty_mod_truncate($string, $length = 80, $etc = '...', $break_words = false)
|
||||
{
|
||||
if ($length == 0)
|
||||
return '';
|
||||
|
||||
if (strlen($string) > $length) {
|
||||
$length -= strlen($etc);
|
||||
$fragment = substr($string, 0, $length+1);
|
||||
|
Reference in New Issue
Block a user