note 106508 added to function.substr
| From: | MaddyVora at osu1 dot php dot net | Date: | Tue, 15 Nov 2011 09:51:45 +0000 |
| Subject: | note 106508 added to function.substr | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-184447@lists.php.net to get a copy of this message | ||
<?php
// here is the sample code for substr with the use of strip_tags
// munirsunni@gmail.com
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;
}
?>
----
Server IP: 59.162.86.123
Probable Submitter: 122.169.48.233
----
Manual Page -- http://www.php.net/manual/en/function.substr.php
Edit -- https://master.php.net/note/edit/106508
Del: integrated -- https://master.php.net/note/delete/106508/integrated
Del: useless -- https://master.php.net/note/delete/106508/useless
Del: bad code -- https://master.php.net/note/delete/106508/bad+code
Del: spam -- https://master.php.net/note/delete/106508/spam
Del: non-english -- https://master.php.net/note/delete/106508/non-english
Del: in docs -- https://master.php.net/note/delete/106508/in+docs
Del: other reasons-- https://master.php.net/note/delete/106508
Reject -- https://master.php.net/note/reject/106508
Search -- https://master.php.net/manage/user-notes.php