I have a news script and I want to display only the first 300 character continued with a "read more" link. If I cut off the string at character 300 it is possible that I destroy a html tag with this. For example:
original string:
"This is a <a href=\"http://www.phpbuilder.com/\">link</a> and this is another <a href=\"http://www.phpbuilder.com/\">one</a>"
shorten string:
"This is a <a href=\"http://www.phpbuilder.com/\">link</a> and this is another <a href=\"http://ww"
Result: String is shorten but the html tag (<a href="..) is destroyed. So ... is there any possibility to shorten a string without destroying any html tags?
Daniel