0% found this document useful (0 votes)
154 views2 pages

How To Replace The Long Text With Dots

Php can easily replace the long text with the dots. Here we use the substr function in php. The output is ABCDEFGHIJKLMNO. The first fifteen letters are printed and the remaining with dots.

Uploaded by

TechnoTiger
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
154 views2 pages

How To Replace The Long Text With Dots

Php can easily replace the long text with the dots. Here we use the substr function in php. The output is ABCDEFGHIJKLMNO. The first fifteen letters are printed and the remaining with dots.

Uploaded by

TechnoTiger
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

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"


"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<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…

For more information visit

http://php.net/manual/en/function.substr.php
Please visit

http://technotiger87.blogspot.com

Leave the comments to improve us..

You might also like