Jump to content

Randomly Read URL from .txt File


cyfer65

Recommended Posts

Easy and sleazy, untested but should work

// somefile.txt contains your list of URLs$url_list = file('somefile.txt'); // randomly pick from the list of URLs$random_url = $url_list[rand(0, count($url_list) - 1)]; // send user to the randomly picked URLheader("Location: $random_url");

How can I Randomly Read a line from hosted .txt File that contains multiple lines of URL's and then make the PHP page forward to that URL it randomly chose...?
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...