<?php
/*
Simple randomizer.
Roger Johansson, http://www.456bereastreet.com/
*/
echo '<ul>' "\n";
$items = array(
    
=> array(
        
'href' => 'url-1',
        
'title' => 'title-text-1',
        
'src' => 'image-1.jpg',
        
'alt' => 'alt-text-1'
    
),
    
=> array(
        
'href' => 'url-2',
        
'title' => 'title-text-2',
        
'src' => 'image-2.jpg',
        
'alt' => 'alt-text-2'
    
),
    
=> array(
        
'href' => 'url-3',
        
'title' => 'title-text-3',
        
'src' => 'image-3.jpg',
        
'alt' => 'alt-text-3'
    
),
    
=> array(
        
'href' => 'url-4',
        
'title' => 'title-text-4',
        
'src' => 'image-4.jpg',
        
'alt' => 'alt-text-4'
    
),
    
=> array(
        
'href' => 'url-5',
        
'title' => 'title-text-5',
        
'src' => 'image-5.jpg',
        
'alt' => 'alt-text-5'
    
)
);
$numberOfItems 3// Change to the number of items you want
$randItems array_rand($arrItems$numberOfItems);
for (
$i 0$i $numberOfItems$i++) {
    
$item $arrItems[$randItems[$i]];
    echo 
"\t" '<li class="r' . ($i 1) . '"><a href="' $item['href'] . '" title="' $item['title'] . '"><img src="' $item['src'] . '" alt="' $item['alt'] . '"></a></li>' "\n";
}
echo 
'</ul>' "\n";
?>