Saturday, August 6, 2011

syntax error unexpected EOF PHP

I got a wired error during developing a php page. Eclipse shows a red mark at the end of the php page and resting the mouse on it gives "syntax error unexpected EOF" and when i run the script on xampp it says that it cannot parse.

The red mark at the bottom of the page isn't where the error is because even after deleting a line from the last it doesn't make the error go away.

The reason for this error is not properly closing a delimiter. This can be a bracket of a for statement or if statement or function block. Well for me i had not closed a foreach loop. :(