Why am i seeing "undefined variable" in php?

Example:

echo $undefinedVar;
This error arises when you reference a variable that hasn't been defined.

Solution:

if (isset($undefinedVar)) {
    echo $undefinedVar;
}

Beginner's Guide to PHP