Tutorials Infos - Anleitungen - Hilfe - Dreamcodes
 

Zufalls Links

Zeigt Zufalls Links an
Script:

 <?php
/**
* Zufallslinks ausgeben
*/

$url_list = array(
 
'http://www.spiegel.de',
 
'http://www.heise.de',
 
'http://www.zeit.de',
 
'http://www.sopos.org',
 
'http://www.nytimes.com',
 
'http://www.google.de',
 
'http://www.heisec.de',
 
'http://www.
dreamcodes.de',
);

$nbr2get 3;

srand ((double)microtime()*1000000);

shuffle ($url_list);

$some_random_urls array_slice($url_list0$nbr2get);

foreach(
$some_random_urls as $one_url){
    
printf('<a href="%s">%s</a><br>'$one_url$one_url);
}
?>

 
ID: 1515
eingestellt am: 05.11.2007
Autor: Na
Status zum lesen: Gast
gelesen: 4640
Webseite: www.dreamcodes.com
[Drucken]