<body>
<div id=banner>
<?php
//Add as many links you want
$mylink[1] = '<a href="http://www.pegor.com">
<img src="images/banner1.jpg" width="468" height="60" alt="some_tex_here">
</a>';
$mylink[2] = '<a href="http://www.lifestinks.info">
<img src="images/banner2.jpg" width="468" height="60" alt="some_tex_here"></a>';
$mylink[3] = '<a href="http://www.mozilla.org"><img src="images/banner3.jpg" width="468" height="60" alt="some_tex_here"></a>';
//$mylink[4] = .....
//$mylink[5] = ....
// this will count your links itself and select a random one
$id = rand(1,count($mylink));
// this will display the random link
echo $mylink[$id];
?>
</div>
<?php
$urls = [
'https://www.someurl.com/' ,
'https://www.someotherurl.com/' ,
'https://www.anothersomeurl.com/' ,
'https://www.someurllmao.com/' ,
'https://www.something.com/' ,
'https://www.ha-ha-its-a-url.com/',
];
$url = $urls[rand(0,sizeof($urls)-1)];
header('Location: '.$url);
?>
<?php
header('location: ' . file("urls.txt")[mt_rand(0,count(file('urls.txt'))-1)]);
?>
<?php
$files = file("urls.txt");
$url = $files[mt_rand(0,count($files)-1)];
header('location: ' . $url);
?>
$urls = array(
'link1',
'link2'
);
header('Location: ' . $urls[array_rand($urls)]);
$connect = your mysqli fetch row command
$url = array();
While($connect as $r){
$url[] = $r[urls];
}
print_r($url);