I have tags that separated by ;
in MySQL database and they are all in one field.
so whenever I try to load the field. the data will be displayed like this :
tag1 ; tag2 ; tag3
What I want to do, is to add url to every tag. basically I want to display it like this:
<a href="http://example.com/tag1">tag1</a>
<a href="http://example.com/tag2">tag2</a>
<a href="http://example.com/tag3">tag3</a>
I was thinking to use str_replace
to replace the ;
with </a>
but how do I do the beginning of each tag!
Is there a code that does that better than str_replace
?