I have a keyword field in a mysql database that I am trying to break down each comma separated phrase in the field and make them into clickable links. i.e keyword keyword2 keyword3.... I am using $words = explode(",", $keywords); to breakdown the data to single phrases contained in an array but need to figure out how to break the array down into clickable links (i.e /search.php?t=$words) for each individual phrase. Assuming that it should be easy but my PHP isn't the greatest. Any suggestions greatly appreciated
Try this: <?php foreach ( explode(",",$keywords) as $word ) { echo "<a href=\"/search.php?t=$word\">$word</a> "; } ?> Code (markup):