I'm calling a random line of text from another file, using the following code:
Code: Select all
function RandomLine($seed) {
$textfile = "links.txt";
$sites = array();
if(file_exists($textfile)){
$sites = file($textfile);
srand ($seed);
$string = $sites[array_rand($sites)];
} else {
$string = "Error";
}
return $string;
}
$s0 = RandomLine(rand((float) microtime(), 10000000));
echo $s0;
Please help! =)