Ok so basically this code grabs 5 random links out of feedlist.txt, however how can i make it so that it wont pick two of the same?
<?php
$chars = "";
$chars = file('feedlist.txt');
function random_subarray($ary, $len, $key) {
srand($key); shuffle($ary);
return array_slice($ary, 0, $len);
}
example
srand((double)microtime()*1000000);
$code = rand(0,100);
$fred = (random_subarray($chars, 5, $code));
foreach ($fred as $key) {
$count++;
echo " <a href='d'>$key</a><br /> ";
}
?>