Why doesn't the following code work?, I keep getting greeted with the following error message:
Warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in C:\Documents and Settings\User\Desktop\Xampp\htdocs\1.php on line 7.
<?php
session_start();
if (array_key_exists($_GET['id'], $array))
{
echo "Already Exists!";
}
else
{
$_SESSION['ids'][] = $_GET['id'];
$array = $_SESSION['ids'];
}
print_r($array);
?>