/ Published in: PHP
Expand |
Embed | Plain Text
function myTruncate($string, $limit, $break=".", $pad="...") { // return with no change if string is shorter than $limit return $string; // is $break present between $limit and the end of the string? } } return $string; } /***** Example ****/ $short_string=myTruncate($long_string, 100, ' ');
You need to login to post a comment.
