I have a description field that uses a Rich Text Editor.
When I display the results on an overview page I want to limit the characters. I am having an issue with html tags getting cut off and, as a result, the rest of the page is not rendered correctly.
Example:
<span font-family="arial, ...
Currently using:
$CharacterLimit=200; // Define how many characters to be displayed in the description
$ColumnLimit = substr($description, 0, $CharacterLimit);
echo "<td colspan='6'>".$ColumnLimit."...</td>\n";
Any help would be appreciated.
David
When I display the results on an overview page I want to limit the characters. I am having an issue with html tags getting cut off and, as a result, the rest of the page is not rendered correctly.
Example:
<span font-family="arial, ...
Currently using:
$CharacterLimit=200; // Define how many characters to be displayed in the description
$ColumnLimit = substr($description, 0, $CharacterLimit);
echo "<td colspan='6'>".$ColumnLimit."...</td>\n";
Any help would be appreciated.
David
-
Re: CharacterLimit and Richtext Editor Issue
Sun, September 30, 2007 - 2:24 AMYou could use "striptags" to filter the tags from the text and then do the "substr" on the filtered text. of course you'd lose all formatting, but on an overview-page you might be able to live with that. -
-
Re: CharacterLimit and Richtext Editor Issue
Sun, September 30, 2007 - 10:10 AMThat will work.
Thanks for your help.
Dave
-