Short example:
$text = "this is a nasty test of a string cutter";
function shortenstring($text) {
if (strlen($text) < 15) return $text;
return substr($text, 0, 14) . "...";
}
print shortenstring($text);
would display the 15 first chars of $text and append three dots. (theoretically).
If you actually want as many dots as the string is (it could look that way from your post), then you could use this method:
$dots = "";
for ($x = 0; $x < strlen($text)-15; $x++)
$dots .= ".";
Note that 15 is just a number of chars I chose =)