php syntax

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dimao
Forum Newbie
Posts: 2
Joined: Wed Oct 08, 2008 4:30 pm

php syntax

Post 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
SBro
Forum Commoner
Posts: 98
Joined: Tue Sep 30, 2003 10:06 pm

Re: php syntax

Post 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;"
dimao
Forum Newbie
Posts: 2
Joined: Wed Oct 08, 2008 4:30 pm

Re: php syntax

Post by dimao »

thank you ,
it's solve my problem.
Post Reply