/ Published in: PHP
// quick function to cut back on the length of content
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function trunCate($string, $limit, $break=".", $pad="...") { // return with no change if string is shorter than $limit // is $break present between $limit and the end of the string? } } return $string; }
URL: http://www.the-art-of-web.com/php/truncate/