I'm making a site, lets just say it was a blog. Each thing has decription tags that are pulled from a mysql datatable which is seperated by a comma and a space An example might be: sprint, nextel, nextell, push, salt I want to be able to link every word to a search result page like search.php?q=sprint search.php?q=push search.php?q=nextell Any idea or codesnippets on how to do that?
I figured it out, this works exactly how I needed it. echo("Tags: "); $a = split(', ', $myrow['tags']); foreach ($a as $value) { echo("<a href=\"search.php?q=" . $value . "\">" . $value . "</a>, "); } echo("<br />"); PHP:
It is batter to urlencode the search terms. echo("<a href=\"search.php?q=" . urlencode($value) . "\">" . $value . "</a>, "); PHP: