View Single Post
Old 11-01-2009, 08:51 PM   #3 (permalink)
Rhinos
The Wanderer
 
Join Date: Aug 2009
Posts: 17
Thanks: 0
Rhinos is on a distinguished road
Default

You could use your function and then use a regular expression to remove all the <acronym> tags that appear inside <a> tags.

Here is a regular expression I have come up with. I have only tested it using a javascript regexp tester at http://www.regular-expressions.info/...ptexample.html

It should be the same for PHP though:

PHP Code:
$the_content preg_replace('~(<a.*>)<acronym.*>(.*)</acronym>(</a>)~i''$1$2$3'$the_content); 
Let me know how you get on.
Rhinos is offline  
Reply With Quote
The Following User Says Thank You to Rhinos For This Useful Post:
unitechy (11-02-2009)