again. Right now I'm having issues with some pretty basic functionality in PHP. I have a web page which includes the following code:
function laserOn()
{
$_SESSION['laser'] = TRUE;
$num_victims = rand(2,125);
$vic = rand(0, count($victims) - 1);
print $num_victims." ".$victims[$vic]." have been vaporized!<br />";
}
and a separate file, victims.php which i have require_once'd, that contains
$victims = array(
1 => "chickens",
2 => "horses",
3 => "werewolves",
4 => "zombies",
5 => "vampires",
6 => "cows"
);
The page, though, only displays the number and the string, not the array value. WHat am I doing wrong here?