View Single Post
Old 02-18-2007, 04:23 PM  
jayeff
Confirmed User
 
Join Date: May 2001
Posts: 2,944
This is similar to at least one above, but it will allow you to specify how many links to show from the main list. In this example, 0 through 24 = 25:
Code:
<?php
$links=file("http://yourdomain.com/yourfile.html");
shuffle($links);
$output = array_slice($links, 0, 24);
foreach ($output as $a) {
    echo $a; 
} 
?>
You do not need to put a full URL in for the file, but I use this code on several sites to generate random lists from a single "master".
jayeff is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote