View Single Post
  #5 (permalink)  
Old 01-26-09, 05:49 PM
nachenko's Avatar
nachenko nachenko is offline
New Member
 
Join Date: Jan 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
oh, yeah, thanks a lot, this saved my ***.

BTW, the expression had a quirk. It was cutting the last letter from all tags that had no attributes, but this problem has a very easy solution:

Code:
preg_replace('/<\s*(\w+) [^>]+>/i', '<$1>',$content);
Notice i added a space between w+) and [^. I'm not sure how good this solution is, but it works for me.
Reply With Quote