check undefined in php code example
Example 1: php see if undefined
if (isset($variable)) { /* do something */ };
Example 2: isset in php
//with new features in new PHP versions like 7
//you can simplify writing of isset in the following way,
//old way of isset to display name if name variable is not null
echo isset($name) ? $name : "no name"
//new and simple way with null coalescing operator
echo $name ?? "no name"