CharacterLimit and Richtext Editor Issue

topic posted Sat, September 29, 2007 - 4:38 PM by  david
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
posted by:
david
Nevada

Recent topics in "PHP Developers"

Topic Author Replies Last Post
using dreamweavers PHP Jivatma 2 August 4, 2008
Another question about formatting date & time SMSapphire 6 June 7, 2008
phpews Satinder 0 June 4, 2008
how works with joomla ??? iShaun 1 May 22, 2008