note 52085 added to function.strip-tags
| From: | bryn-at-drumdatabasedotnet at osu1 dot php dot net | Date: | Wed, 20 Apr 2005 21:38:51 +0000 |
| Subject: | note 52085 added to function.strip-tags | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-88294@lists.php.net to get a copy of this message | ||
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.
----
Manual Page -- http://www.php.net/manual/en/function.strip-tags.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+52085
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52085&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52085&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52085&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52085&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52085&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+52085&report=yes
Search -- http://master.php.net/manage/user-notes.php