How can I make random links from a text document ? so I just need to add links to this txt file and they appear random on a website.
Thanks in advance
Blackhat
Random links Question
Moderator: General Moderators
Code: Select all
$links = file("links.txt");
echo $links[rand(0,sizeof($links)-1)];
Last edited by []InTeR[] on Wed Jun 11, 2003 7:42 am, edited 5 times in total.
if you have one link per line in that file
take a look at http://php.net/file and http://php.net/array_rand
edit: @Inter: readfile adds the contents to the output stream and returns the size.
take a look at http://php.net/file and http://php.net/array_rand
edit: @Inter: readfile adds the contents to the output stream and returns the size.