[PHP] heredoc syntax vs Double-Quotes
Hi, Not looking to start some pugilistic fray, but when is using heredoc advisable over Double-Quotes? Return True, Christopher Kennon Principal/Designer/Programmer -Bushidodeep http://bushidodeep.com/ __ Knowing is not enough, you must apply; willing is not enough, you must do. ---Bruce Lee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] heredoc syntax vs Double-Quotes
Chris Kennon wrote: Hi, Not looking to start some pugilistic fray, but when is using heredoc advisable over Double-Quotes? Probably with really long strings or pages of data so you don't have to worry about quotes etc. Pretty much comes down to personal preference I think. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] heredoc syntax vs Double-Quotes
At 07:06 PM 3/15/2006, Chris Kennon wrote: when is using heredoc advisable over Double-Quotes? I love using heredoc primarily because it helps me separate logic from markup when generating HTML. The text in a heredoc expression is vanilla, no escape sequences needed, so there's less worry about typos. I find it one of the strongest features of PHP as compared to other scripting languages. Paul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] heredoc syntax
anyone know why heredoc syntax might not work with php5/apache installed. I can't get even the simplest strings in heredoc syntax to work and I've tried just cutting and pasting other peoples stuff in that syntax as well, and still no luck thx. Adil. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] heredoc syntax
Adil wrote: anyone know why heredoc syntax might not work with php5/apache installed. I can't get even the simplest strings in heredoc syntax to work and I've tried just cutting and pasting other peoples stuff in that syntax as well, and still no luck thx. Adil. Heredoc syntax is pretty rigid and it's easy to have it wrong invisibly. $varname = END Text of string END; The first END must be at the end of the line, nothing after it, not even a blank space. The last END must be at the beginning of the line, not before it, not even a blank space. Janet -- Janet Valade -- janet.valade.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] heredoc syntax
* Janet Valade [EMAIL PROTECTED]: Adil wrote: anyone know why heredoc syntax might not work with php5/apache installed. I can't get even the simplest strings in heredoc syntax to work and I've tried just cutting and pasting other peoples stuff in that syntax as well, and still no luck Heredoc syntax is pretty rigid and it's easy to have it wrong invisibly. ^ That's the key -- whitespace is invisible to the naked eye typically. $varname = END Text of string END; The first END must be at the end of the line, nothing after it, not even a blank space. The last END must be at the beginning of the line, not before it, not even a blank space. And don't forget that the last END must be followed by a semi-colon ONLY, no other characters on that line... ;-) -- Matthew Weier O'Phinney | mailto:[EMAIL PROTECTED] Webmaster and IT Specialist | http://www.garden.org National Gardening Association| http://www.kidsgardening.com 802-863-5251 x156 | http://nationalgardenmonth.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php