Page 1 of 1

php syntax

Posted: Wed Oct 08, 2008 4:41 pm
by dimao
hi,
may ,please, somebody explain me what i am write wrong:

Code: Select all

 
print <<<END
HELLO WORLD
END;
 
ERROR :Parse error: syntax error, unexpected $end in C:\wamp\www\account.php on line 26

thanks

Re: php syntax

Posted: Wed Oct 08, 2008 6:04 pm
by SBro
From the manual
It is very important to note that the line with the closing identifier must contain no other characters, except possibly a semicolon (;). That means especially that the identifier may not be indented, and there may not be any spaces or tabs before or after the semicolon. It's also important to realize that the first character before the closing identifier must be a newline as defined by the local operating system. This is \n on UNIX systems, including Mac OS X. The closing delimiter (possibly followed by a semicolon) must also be followed by a newline.
Basically make sure there is no spaces between the beginning of the line and "END;"

Re: php syntax

Posted: Thu Oct 09, 2008 2:26 am
by dimao
thank you ,
it's solve my problem.