Hi
I have a bit of code that selects data from a MySQL LONGTEXT field. The data will typically contain some HTML tags.
The PHP then cuts this down to 100 characters, and adds ".....[more]" as a clickable link at the end which loads a new page containing the complete data.
If you like, this will produce a list of snippets of ALL entries in the table and the user can choose which one to read in its entirity.
It works brilliantly, but if there are any HTML tags around the 100 character position then random results occur. Well, not random but difficult to calculate.
My solution is to strip out these HTML tags using a PHP function, and then cutting the data down to 100 chars.
The HTML tags I want to remove will be:
<span class='orange'>
</span>
<a href='http://www.google.com'>
</a>
the URL could be anything, any length, any site so can't just hard code those.
Any ideas on how to do such a thing?