I need some help. I have a section that displays keywords “tags”:
<?=str_replace(",",",",$line["m_tags"])?>
The code above looks like this
Tags: KEYWORD1, KEYWORD2, KEYWORD3
All I’m trying to do is have each individual KEYWORD be a hyperlink to link back to the main page.
Any help would be appreciated.
The code you posted does nothing, it replaces
,with,.You can do this with regular expressions, but here is a different method:
Shorter alternative as Felix Kling pointed out: