note 110797 added to function.strip-tags
| From: | sirmagid at gmail dot com | Date: | Sun, 09 Dec 2012 13:46:12 +0000 |
| Subject: | note 110797 added to function.strip-tags | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-192431@lists.php.net to get a copy of this message | ||
function substrword($text, $length = 100, $replacer = '...', $isStrips = true, $stringtags
= '') {
$string = $isStrips ? strip_tags($text, $stringtags) : $text;
$tmp = explode(" ", $string);
if (count($tmp) < $length)
return $string;
$string = implode(" ", array_slice($tmp, 0, $length)) . $replacer;
return $string;
}
----
Server IP: 69.147.83.199
Probable Submitter: 72.52.91.2 (proxied: 31.58.235.248)
----
Manual Page -- http://php.net/manual/en/function.strip-tags.php
Edit -- https://master.php.net/note/edit/110797
Del: integrated -- https://master.php.net/note/delete/110797/integrated
Del: useless -- https://master.php.net/note/delete/110797/useless
Del: bad code -- https://master.php.net/note/delete/110797/bad+code
Del: spam -- https://master.php.net/note/delete/110797/spam
Del: non-english -- https://master.php.net/note/delete/110797/non-english
Del: in docs -- https://master.php.net/note/delete/110797/in+docs
Del: other reasons-- https://master.php.net/note/delete/110797
Reject -- https://master.php.net/note/reject/110797
Search -- https://master.php.net/manage/user-notes.php