jmiller on 02/23/10
Last Edited at 02/23/10 03:28pm
// Trims a string down to a certain length and inserts an ellipses if it was trimmed.function cut($str, $len=30) { if (strlen($str) > $len) { return substr($str, 0, $len-2) . '…'; } else { return $str; }}
Report this snippet Tweet
Comment:
You need to login to post a comment.