PHP Kod: Kodu kopyalamak için üzerine çift tıklayın!
<?php
$imgdir = 'resimlerim/';
$links = array(
'a.jpg' => 'a.html',
'b.jpg' => 'b.html',
'c.jpg' => 'c.html',
'd.jpg' => 'd.html'
);
$pictures = array('a.jpg', 'b.jpg', 'c.jpg');
sufflle($pictures);
$total_show = sizeof($pictures) - 1;
echo "<table cellpadding=\"6\" cellspacing=\"3\" align=\"center\">\n";
for ($i = 0; $i <= $total_show; $i++)
{
$picture = $pictures[$i];
if (!empty($i) AND ($i % 3) == 0)
{
echo "</tr>\n<tr>\n";
}
else if (empty($i))
{
echo "<tr>\n";
}
echo "\t<td><a href=\"" . $links["$picture"] . "\" style=\"text-decoration: none;\"><img src=\"" . $imgdir . $picture . "\" alt=\"\" border=\"0\" /></td>\n";
}
if ($i > 2 AND ($left = ($i % 3)) != 0)
{
echo "\t<td" . ($left == 1 ? " colspan=\"2\"" : "") . "> </td>\n";
}
echo "<tr>\n</table>\n";
?>