[eluser]Bart v B[/eluser]
[quote author="nevsie" date="1270605501"]Hi Noctrum,
That is kind of my point... I am using the session library, and if the item does not exist it throws up the error as mentioned above:
Code:
// Monkey does not exist in session!!!
if ($this->session->userdata['monkey'] !== FALSE) { echo "false is stated"; } else { echo "true is stated"; }
And the error:
A PHP Error was encountered
Severity: Notice
Message: Undefined index: monkey
I know this gives the correct answer and with error reporting off this will be suppressed - but still not ideal...[/quote]
Offcourse it gives an undefined index.
It must be something like this:
Code:
// Monkey does not exist in session!!! mind the () instead of: []
if ($this->session->userdata('monkey') === FALSE)
{
echo "false is stated";
}
else // its true so..
{
echo "true is stated";
}