Grab the RSS feed

How to replace the long text with dots

In php we can easily replace the long text with the dots.

Here we use the substr function in PHP.

The below example shows the program for that….

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "" >
&lthtml xmlns="" >
&lthead >
&ltmeta http-equiv="Content-Type" content="text/html; charset=utf-8" / >
&lttitle &gtUntitled Document</title >
</head >

&ltbody >

if(strlen($message) &gt15)
echo $listedword."...";
echo $message;
? >
</body >
</html >

The output is
The first fifteen letters are printed and the remaining with dots…

For more information visit

For more information

Leave the comments to improve us..

Click Download this as a word document


  • Anonymous said...

    Thank you for the code, it helped greatly.

    I had one question though:

    If $message="techno tiger website"; Then the output is "techno tiger we...".

    Is it possible to write code that will not cut words in half? So for example the code output would be "techno tiger..."?


    technotiger said...

    Pleae use the wordwrap functionality.


    Real Time Web Analytics