Hi all,
I've searched the forums, and checked out the Regular Expressions article here on PHPBuilder, but I'm still unable to accomplish my goal, after hours of tearing my hair out. :p. I guess I'll start off by explaining, what I need to do:
I have a string (it is always different - and always a different length). Within this string there are HTML-Like tags ([lu] and [/lu]). Between those tags, there is a word, which is always different. So, the string looks similar to this:
"This is a [lu]test[/lu] of the search and [lu]replace[/lu] function."
I need to find all instances of the [lu]x[/lu] tags, determine what is between them (x) - and replace them with this string:
"<a href=\"glossary.php?w=x\">x</a>"
Where "x" is the word originally enclosed in the [lu] [/lu] tags.
Hopefully that makes some sense :p.
I've found a few examples of regular expressions that will allow me to retrieve the word between the tags, but I have been unable to successfully read the word and replace the specific sections of my string with the modified <a> </a> tags.
If anyone understands what I'm trying to do, and you can help me...pleaseeeee do! 🙂 Thanks in advance, I really appreciate it!