Vidensdatabase

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 }.

  • 16 Kunder som kunne bruge dette svar
Hjalp dette svar dig?