note 106493 deleted from function.strip-tags by aharvey
| From: | aharvey@php.net | Date: | Thu, 20 Sep 2012 12:15:48 +0000 |
| Subject: | note 106493 deleted from function.strip-tags by aharvey | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-190929@lists.php.net to get a copy of this message | ||
Note Submitter: Maddy Vora
----
Here is the function created for strip tags with sub string
<?php
function displaySubStringWithStrip($string, $length=NULL)
{
if ($length == NULL)
$length = 50;
$stringDisplay = substr(strip_tags($string), 0, $length);
if (strlen(strip_tags($string)) > $length)
$stringDisplay .= ' ...';
return $stringDisplay;
}
?>