Professional Documents
Culture Documents
How To Replace The Long Text With Dots
How To Replace The Long Text With Dots
In php we can easily replace the long text with the dots.
<body>
<?
$message="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
if(strlen($message)>15)
{
$listedword=substr($message,0,15);
echo $listedword."...";
}
else
{
echo $message;
}
?>
</body>
</html>
The output is
ABCDEFGHIJKLMNO...
The first fifteen letters are printed and the remaining with dots…
http://php.net/manual/en/function.substr.php
Please visit
http://technotiger87.blogspot.com