How to redirect to a random link using php
Posted: Mon Feb 22, 2010 9:51 pm
Code: Select all
<?php
// your links array
$links = array(
'https://robot.lk.com',
'http://coderlink.com',
'http://buytiptop.com',
);
// select random link and redirect
header('Location: ' . $links[rand(0,count($links)-1)]);
?>