echo inside control problem

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
pixienick
Forum Newbie
Posts: 12
Joined: Sun May 28, 2006 6:58 pm

echo inside control problem

Post by pixienick »

Hello everyone
What is that problem with echo using

Code: Select all

echo<<<END blah blah 
END;
It dosent always work when inside a control path like a for loop or if statement, why is that?

Thanks
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

If there's whitespace before "END;" on the line it won't be found to terminate the heredoc.
pixienick
Forum Newbie
Posts: 12
Joined: Sun May 28, 2006 6:58 pm

Post by pixienick »

Yeah I'm aware of that. It keeps failing inside control structures, has nobody else seen this problem?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Post your code that fails.
Post Reply