cyfer65 Posted June 29, 2010 Share Posted June 29, 2010 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 More sharing options...
End User Posted June 29, 2010 Share Posted June 29, 2010 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.