note 57594 deleted from control-structures.while by nlopess
| From: | nlopess@php.net | Date: | Sat, 08 Oct 2005 18:11:59 +0000 |
| Subject: | note 57594 deleted from control-structures.while by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-96686@lists.php.net to get a copy of this message | ||
Note Submitter: Lumpy at gravy dot net
Reason: useless
----
This is just fun:
<?php
// define array
$albums[0] = 'Freak Out|freakout.gif|1';
$albums[1] = 'Absolutely Free|absolutelyfree.gif|2';
$albums[2] = 'Lumpy Gravy|lumpy.gif|3';
$albums[3] = 'Uncle Meat|unclemeat.gif|6';
$albums[4] = 'Burnt Weeny Sandwich|burntweeny.gif|9';
// base
$base = 'http://zappa.com/fz/content/discography/';
// page (file)
$file = 'album-detail2.php';
// image directory
$img_dir = 'images/bigger/';
// create counter
$i = 0;
// begin a table
echo '<table cellpadding="5" cellspacing="1"
border="1">' . "\n";
// while $i is less than 5:
while($i < 5){
$parts = explode('|', $albums[$i]);
$img = '<img src="' . $base . $img_dir . $parts[1] .'"
width="200" height="200" />';
$link = $base . $file . '?album_id=' . $parts[2];
echo '<tr><td>' . $parts[0] . '</td>' . "\n";
echo '<td><a href="'. $link . '">' . $img .
'</a></td></tr>' . "\n";
$i++;
}
// end table
echo '</table>';
?>