PHP Parse error: syntax error, unexpected '}'

This error is typically caused by a missing { used in PHP to denote content belonging to a WHILE, IF, or FOR loop.

if (x==y)
do this;
do that;
}
Needs to be:
if (x==y){
do this;
do that;
}

Tip: You can use File Manager's Code Edit feature (in lieu of regular Edit). This special Code Edit will colorize your programming language, and can also quickly identify related pairs of brackets like { and }.


Your comments help us keep the knowledge base updated. This is not a medium for support. If you have questions or need help, please contact us via email, phone or live chat for fast assistance.

Post Comment