note 52085 deleted from function.strip-tags by danbrown
| From: | danbrown@php.net | Date: | Sun, 17 May 2009 16:03:23 +0000 |
| Subject: | note 52085 deleted from function.strip-tags by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-154748@lists.php.net to get a copy of this message | ||
Note Submitter: bryn -at- drumdatabase dot net
----
Further to john780's idea for a solution to the 1024 character limit of strip_tags - it's
a good one, but I think the ltrim function isn't the one for the job? I wrote this simple
function to get around the limit (I'm a newbie, so there may be some problem / better way of
doing it!):
<?
function strip_tags_in_big_string($textstring){
while (strlen($textstring) != 0)
{
$temptext = strip_tags(substr($textstring,0,1024));
$safetext .= $temptext;
$textstring = substr_replace($textstring,'',0,1024);
}
return $safetext;
}
?>
Hope someone finds it useful.