Shorten a string…

Written by khawaib

Topics: PHP

This simple function returns a shorten string back.

function shortenString($string){
	$sep = '...';
	$length = 8;
	echo substr_replace ($string, $sep, $length, - $length);
}

Leave a Comment Here's Your Chance to Be Heard!

You must be logged in to post a comment.