<?php
session_start();
// makes an array
$colors=array('red', 'yellow', 'blue');
// adds it to our session
$_SESSION['color']=$colors;
$_SESSION['size']='small';
$_SESSION['shape']='round';
$_SESSION['diameter']='10cm';
print "Done";
function fnCheckSession(){
if (Session["LoggedIn"] !=null)
echo "Session variable exist.";
else
echo "Session variable does not exist.";
}
fnCheckSession();
?>
I have the following error appears:
Parse error: syntax error, unexpected '[' in C:\xampp\htdocs\php_exercise\exercise2_2.php on line 18
line 18 is : if (Session["LoggedIn"] !=null)
What might be wrong?
Thanks.