09-29-2008, 02:57 PM
|
#1 (permalink)
|
|
The Addict
Join Date: Nov 2007
Location: USA
Posts: 256
Thanks: 7
|
str_ireplace but not within a link tag
I am trying to do a str_ireplace on a long string that can contain links. However I dont want to replace an occurance if it within a <a></a> tags.
The way I was thinking was to explode the string into parts based on the link. so I want the first piece to contain a part of the string part 2 to contain the link part 3 to contain more of the string. Then I can loop through skipping every other part them implode it all back together.
The problem is that I cannot set a wildcard (or just dont know how) within my str_ireplace tag. I would want something like str_ireplace("<a*</a>", $string); where the * is a wild card.
Any ideas?
|
|
|
|