In a table I have a column containing names that I want to assign URLs to.
http://kissbandstree.com/artists.php
The list:
Eric S. = <a href='/artist.php?a=eric_singer'>
Eric C. = <a href='/artist.php?a=eric_carr'>
Bruce = <a href='/artist.php?a=bruce_kulick'>
Ace = <a href='/artist.php?a=ace_frehley'>
Gene = <a href='/artist.php?a=gene_simmons'>
Paul = <a href='/artist.php?a=paul_stanley'>
Peter = <a href='/artist.php?a=peter_criss'>
Vinnie = <a href='/artist.php?a=vinnie_vincent'>
Mark = <a href='/artist.php?a=mark_st_john'>
Tommy = <a href='/artist.php?a=tommy_thayer'>
There can be several names per table cell, for instance:
Ace, Eric S., Bruce
The names are to be links, and the white spaces and commas between names logically not.
The output Iām trying to achieve would be:
<a href='/artist.php?a=ace_frehley'>Ace</a>, <a href='/artist.php?a=eric_singer'>Eric S.</a>, <a href='/artist.php?a=bruce_kulick'>Bruce</a>
This is the code (without links) thatās in use now:
echo "<td class='notwrap' style='text-align: left;' title='" . trim($contents[5]) . "'>" . trim($contents[5]) . "</td>";