Is there a way to check if an array index exists or is null?
isset()
doesn't tell you whether the index doesn't exist or exists but is null.
If I do : isset($array[$index]) || is_null($array[$index])
it won't work because if the index doesn't exist is_null will crash.
How can I check this please? Also is there a way to check only if something exist, no matter if it is set to null or not?
Simplest defined in: http://php.net/manual/en/function.array-key-exists.php
The function array_key_exists() can do that, and property_exists() for objects, plus what Vineet1982 said. Thanks for your help.
This is the very good question and you can use get_defined_vars() for this:
This will solve your problem