Last Updated: February 25, 2016
·
388
· brendanmurty

Blurb content

Shorten $content to a $length of characters.

<?
function blurb($content,$length){
$content_length=mb_strlen($content);
if($content_length>=$length){// Too long, return the shortened string
    return mb_substr($content,0,$length-3).'...';
}else{// All good, return the string unchanged
    return $content;
}
}
?>