Skip to content

Instantly share code, notes, and snippets.

function ShortenText($text, $chars) {
// Change to the number of characters you want to display
$text = $text." ";
$text = substr($text,0,$chars);
//$text = substr($text,0,strrpos($text,' '));
$text = $text."...";
return $text;
}
@pa-gerrit
pa-gerrit / gist:3759362
Created September 21, 2012 01:56
shortening text, max characters hard coded
function ShortenText($text) {
// Change to the number of characters you want to display
$chars = 25;
$text = $text." ";
$text = substr($text,0,$chars);
//$text = substr($text,0,strrpos($text,' '));
$text = $text."...";
return $text;
}
/* Clear Fixes - two methods, clear-fix is attached to the element you want to clear, .clear-all you can attach to a hr or br tag to clear the item before it as a last resort when you're in a hurry */
.clear-fix { display: inline-block; } /* This needs to be first because FF3 is now supporting this */
.clear-fix:after { content: " "; display: block; height: 0; clear: both; font-size: 0; visibility: hidden; }
.clear-all { visibility: hidden; clear: both; margin: 0 !important; padding: 0 !important; font-size: 0; height: 1px; }