
06-10-03, 07:54 PM
|
 |
Eeew, dirty!
|
|
Join Date: Jun 2003
Location: Toronto, Ontario
Posts: 88
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
PHP Code:
<?php
$ile = 3;
// I used this line to test it
// $file = array(1,2,3,4,5,6,7,8,9,0);
$file = file("pics.txt");
echo '<table width="600"><tr>';
echo "\n";
srand((double)microtime()*1000000);
$keys = array_rand($file, $ile);
for($i=0; $i<$ile; $i++)
{
$sp = explode('||', $file[$keys[$i]]);
if($sp[0] != '')
{
echo '<td align=middle>';
echo "\n";
echo '<a href="'.$sp[2].'"><img src="'.$sp[0].'" border=3></a><br>';
echo "\n";
echo '<font style="font-weight: bold; font-size: 11px; font-family: Tahoma">'.$sp[1].'<br></font>';
echo "\n";
echo '</td>';
echo "\n";
}
}
echo '</tr></table>';
echo "\n";
?>
Doh! I was using array_rand wrong  This should work now.
|