Quote:
Originally posted by Repetitive Monkey
Wrong. Your script has a 1/(number of lines+1) chance of echoing absolutely nothing. You have to decrease count($links) by one.
|
So...
<?php
$links = file("links.txt");
echo $links[rand(0,count($links))];
?>
How do you do that?
<?php
$links = file("links.txt");
echo $links[rand(-1,count($links))];
?>
?