-1
$urls = array("http://google.com" ,"http://hotmail.com" ,"http://yahoo.com" ,"http://stackoverflow.com" ,"http://bing.com" ,"http://cnn.com");
$text = array("Google" ,"Hotmail" ,"Yahoo" ,"Stackoverflow" ,"Bing" ,"CNN");
srand(time());
$random = (rand()%3);
echo ("<a href = \"$urls[$random]\">$text[$random]</a>");
上面會做到這一點:如何顯示3項一次 - 陣列
<a href="http://www.stackoverflow.com">Stackoverflow</a>
如何顯示例如雅虎,谷歌3個環節,兵