I know everybody knows how todo it, but cutting text according to text length is needed almost in any content driven website to avoid breaking design. here is my handy function for cutting text:
function wordcutter($string , $cutnum) {
$wordcutter = strlen($string);
if ($wordcutter > $cutnum) {
$titlecut = substr($string, 0, $cutnum);
$titlecut .= ‘…’;
echo $titlecut;
} else {
echo $string;
}
}
- BROWSE / IN TIMELINE
- « Handy CSS trick i found on the web
- » My life, told by Wil Schroter from Big Network
- BROWSE / IN service web 2.0 software usability code
- « Handy CSS trick i found on the web
- » My life, told by Wil Schroter from Big Network
SPEAK / ADD YOUR COMMENT
Comments are moderated.
