function kisalt($text, $length, $suffix = '...') {
if(strlen($text) > $length) {
$text = substr($text, 0, $length) . $suffix;
}
return $text;
}



kullanım

kisalt("Yazı yazıyorum çok uzun ama ", 20);