What I'm trying to do is, replacing symbols that would be changed start the string then the last symbol that would close the string - changing both of them into a link then it will be stored into the database, it's something like Wikipedia.
I want to have something like this when someone types in the textarea:
"This woman was killed by [Tom Hanks] in 2002"
The [
and ]
will be converted into a link with the Tom Hanks in the link href (which is directed by htaccess - I've done this already).
So, it should output something like this:
"This woman was killed by <a href=\"Tom Hanks\">Tom Hanks</a> in 2002"
The link location will always be the name of the wrapped text.
After that, it should be able to be stored into the database with the slashes.