So I have this while loop in a function that is called in the middle of a page:
The funny thing is: it works for one page (it's used to list randomly generated links depending on which ID is taken from the URL) - that is, where ID = 1, but on all other pages, it just kills the script and nothing after it is outputted. I would really appreciate any help on figuring this out.
Code:
while(count($showarray) <= $show_link){
$randindex = rand(0, count($newlinks));
if(!in_array($newlinks[$randindex], $showarray) && $newlinks[$randindex] != "") {
$showarray[$showindex] = $newlinks[$randindex];
//print_r($showarray);
$showindex++;
}
}
Comment