When checking a superglobal like $_GET or $_POST for existence of a value for a particular key, is there a method that encompasses the following functionality in a more concise way?
if (isset($_POST['foo']) && $_POST['foo'] !== '') {
// ...
}
The isset() function by itself returns TRUE even when the value is an empty string '', so I can't use that.
Using just $_POST['foo'] !== '' will work correctly by itself, but it emits an E_NOTICE for undefined index, which is undesirable.
The empty() function returns TRUE for the value "0", which is a valid value, so I can't use that, either.
Am I missing something obvious, or is this really the best/only way to do it?