How to resolve 'unexpected $end' in php?

Example:

if ($var > 10) {
    echo "Greater";

The error suggests that PHP has reached the end of the file and hasn't found what it's looking for, usually a missing closing brace or parenthesis.

Solution:

Add the missing closing brace or parenthesis.


if ($var > 10) {
    echo "Greater";
}

Beginner's Guide to PHP