<?php
//array filled with links (text, URL)
//generated at [URL="http://www.seoname.net"]www.seoname.net[/URL]
function randlink($links)
{
$r_index = rand(0, count($links) - 1); // Get random index within list range
list($name,$url) = $links[ $r_index ]; // Grab name and URL of random array element
return sprintf('<li><a href="%s">%s</a></li>', $url,$name); // Format a lnk string and return it
}
//array filled with links (text, URL)
$links = array(
array('URL 1', 'http://'),
array('URL 2', 'http://'),
array('URL 3', 'http://')
);
//echo random link
echo randlink($links);
?>