Like iPhone app names that last longer, the name is abbreviated. I really like this method of locking a name or string, and then adding the sentence "..." to it. Sorry if I get confused, I am having trouble explaining what I'm trying to do. Therefore, I will set an example!
This is what I have, add "..." to the shortened string (in PHP)
<?php
$string = "This is a test script";
if (strlen($string) >= 14)
echo(substr($string), 0, 13). "...");
else
echo($string);
?>
I would like to split the name or string and save the first 10 characters, then insert the “...” in the middle and finally take the end of the 5 letters of the string and display them. I was thinking of something like:
<?php
$string = "This is a test script";
if (strlen($string) >= 20)
echo(substr($string, 0, 10). "..." .substr($string, 15, 20));
else
echo($string);
?>
But understand that this will not work in the sense that in the end there are only 5 letters left. Any directional pointers would be great, thanks!