weird rand() issue
Posted: Thu Aug 11, 2005 9:16 am
ok i have a function and i call it like this
now the first few lines of this function look like this
now if when i call the function with any number other than -1 the page looks like it loads but nothing changes like if i put in -1 then loaded the page then changed the -1 to 2 and hit refresh nothing happens, like it says the pages loads but there are no changes, even if i put like echo $max. it does not give me any error messages and if i try to view the page in IE with a value for $max anything but -1 it gives me a can not find page error. this makes absolutly no sence to me so any ideas is great
Code: Select all
$arr = find_random_link_spot($arr, 'diet_patch.htm', 'Diet Patch Report', -1);Code: Select all
function find_random_link_spot($lines, $filename, $keys, $max)
{
if ($max == 0)
return $lines;
$max = ($max == -1 ? count($lines) : $max);
$random = rand(0, $max);