Hi there!
I am trying to make a function to parse BB Code. I would be able to make a simple one, e.g. replace [img] with <img src=" and [ /img] with "> etc.
However, this could cause problems if the tags are not completed. For example, if the user only typed in and did not close it, this would be replaced with <b> which would not be closed, thereby making the entire page bold, or underlined, or a link etc.etc.
How would i be able to get around this? or are there any functions currently available which i could use/look at/edit?
My initial idea was to find the number of closed tags (& replace them), then replace that number of opening ones.
Any ideas??
Thanks!!