I am currently inserting some body text into the DB. This is just plain text, but the users are also wanting to be able to add working links. To save making mass changes I am doing these changes be using a pop up that will insert their link in the following format:
[a]http://www.google.com[/a]
Each body text can have more than one link in.
When this is displayed on the relevant webpage the links will change to a standard html format:
<a href="http://google.com">http://www.google.com</a>
I can't seem to be able to setup a preg_match to get this to do this multiple times in a string (see example below):
hello world [a]http://google.com[/a] how are you?
Ok. [a]http://yahoo.com[/a] Thanks for asing. [a]http://bing.com[/a]
Any help would greatly be appreciated!!!
Thanks, Kane
code/[a](.*)[/a]/codeBut it would return the following:code1 => google.com[/a] how are you? Ok. [a]yahoo.com[/a] Thanks for asing. [a]bing.comcodeSo it was only getting the outside "[a]" and "[/a]"