Currently, I check to see if a $_GET
or $_POST
property is set by using empty()
. Like this:
$status = null;
if (!empty($_GET['foo'])) {
$status = $_GET['foo'];
}
I imagine there is an even more concise way of doing the same thing built into PHP, that like what I'm doing now with empty
, also avoids printing the notice saying undefined index. Maybe something like this:
$status = something($_GET['foo']);
Or, maybe I should just ignore the notice and do:
$status = $_GET['foo'];