基本上,我试图创建一个random.php页面,如果有人继续使用它,它会将它们重定向到我想要的特定链接,并且每次他们继续使用随机链接.php将会有一个不同的链接例如......
$urls = array('http://gamingwebsite.com/xlnc', 'http://gamingwebsite.com/xln8', 'http://gamingwebsite.com/xln5', 'http://gamingwebsite.com/xln4',
'http://gamingwebsite.com/xlmv', 'http://gamingwebsite.com/xlms', 'http://gamingwebsite.com/xllz', 'http://gamingwebsite.com/xllp', 'http://gamingwebsite.com/xllj',
'http://gamingwebsite.com/xlle', 'http://gamingwebsite.com/xll9', 'http://gamingwebsite.com/xll5', 'http://gamingwebsite.com/xlks', 'http://gamingwebsite.com/xlkl',
'http://gamingwebsite.com/xlke', 'http://gamingwebsite.com/xlk4', 'http://gamingwebsite.com/xljv', 'http://gamingwebsite.com/xlje', 'http://gamingwebsite.com/xlj9',
'http://gamingwebsite.com/xlj1', 'http://gamingwebsite.com/xjxu', 'http://gamingwebsite.com/xjxd', 'http://gamingwebsite.com/xjx4', 'http://gamingwebsite.com/xjwz',
'http://gamingwebsite.com/xjw1', 'http://gamingwebsite.com/xjup', 'http://gamingwebsite.com/xjtz', 'http://gamingwebsite.com/xjtt', 'http://gamingwebsite.com/xjtn',
'http://gamingwebsite.com/xjrh', 'http://gamingwebsite.com/xjrd', 'http://gamingwebsite.com/xjr3', 'http://gamingwebsite.com/xj1z', 'http://gamingwebsite.com/xizx',
'http://gamingwebsite.com/xizf', ' http://gamingwebsite.com/x3jx', 'http://gamingwebsite.com/x3jp');
这就是我所做的事情,我怎么能这样做,每当有人继续使用random.php它会将它们重定向到其中一个链接?
答案 0 :(得分:3)
header('Location:'. $urls[rand(0, (count($urls)-1))]);
或使用array_rand()
header('Location:'. $urls[array_rand($urls, 1)]);
答案 1 :(得分:3)