I have a HTML Table that I'd like to add a column of links to.
Here's my array
$unis = array(
array("title"=>"http://www.aber.ac.uk/en/"),
array("title"=>"http://www.bangor.ac.uk/")
);
I want to track through the array and print out each link. So I have two Universities in the HTML table and their respective links to appear alongside of them.
Here's my script so far but this prints out two columns with the above links for every record in the table so it looks like
foreach ($a as $i) {
echo "<tr><td><img class='uni-image' src='" . $dir . '/' . $i . "' /></td>";
echo "<td>" . pathinfo($i, PATHINFO_FILENAME) . "</td>";
foreach ($unis as $row) {
array_map('htmlentities', $row);
echo "<td>" . implode($row) . "</td>";
}
echo "</tr>";
And the result is
Uni logo | Uni name | http://www.aber.ac.uk | http://www.bangor.ac.uk
Uni logo#2 | Uni name#2 | http://www.aber.ac.uk | http://www.bangor.ac.uk
When what I really want is
Uni logo | Uni name | http://www.aber.ac.uk
Uni logo#2 | Uni name#2 | http://www.bangor.ac.uk
$ais an array loaded with the image and university names @u_mulder