You can use isset() , empty() , or is_null() to check if a variable is declared and is different than null. You can also use the built-in empty() function. There are two tips that you can use to write more concise code and avoid errors.
Sort: