On 06/07/11 17:33, Robert Williams wrote:
Where I've made most use of heredocs is when I want to do nothing but define a
bunch of
long strings in one file.
I find the most useful thing about heredocs is that they don't care about
quotation marks, so I often use them for SQL statements where I
On 11-07-06 02:59 PM, Jim Giner wrote:
I LOVE the heredocs tool. I only learned about it a couple of months ago -
what a find! It makes generating my html for my web pages so much
easier and allows me to include my php vars within the html with much less
confusion and simplifies the intermi
I LOVE the heredocs tool. I only learned about it a couple of months ago -
what a find! It makes generating my html for my web pages so much
easier and allows me to include my php vars within the html with much less
confusion and simplifies the intermixing of html and php vars - no more
s
On 2011-07-6 08:09, "ad...@buskirkgraphics.com"
wrote:
>I use constants in my OOP and I never use the heredoc syntax. Now I am
>fearing that I have not taken advantage of something.
>My understanding of heredoc syntax as of 5.3 is just a string quoting
>right?
>Is there an advantage of using th
> -Original Message-
> From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk]
> Sent: Wednesday, July 06, 2011 10:49 AM
> To: ad...@buskirkgraphics.com; 'Dave Wilson'; php-general@lists.php.net
> Subject: RE: [PHP] Constants in strings
>
>
&g
Yeah, that was my answer and I was rebuked for that.
ad...@buskirkgraphics.com wrote:
>> -Original
Message-
>>
From: Dave Wilson
[mailto:dai_bac...@hotmail.com]
>> Sent: Wednesday, July 06,
2011 10:11 AM
>> To: php-general@lists.php.net
>>
Subject:
>
>define('DIR_JAVA', '/js/');
>
>When you need to use the JavaScript directory you can do this.
>
>
>There is no true need for the curly brackets to echo out the value of
>the constant.
>
Except for when you're using heredoc, much like in the OPs first post...
Thanks,
Ash
http://www.ashleysher
> -Original Message-
> From: Dave Wilson [mailto:dai_bac...@hotmail.com]
> Sent: Wednesday, July 06, 2011 10:11 AM
> To: php-general@lists.php.net
> Subject: Re: [PHP] Constants in strings
>
> On Wed, 06 Jul 2011 12:56:21 +0100, Stuart Dallas wrote:
> > My
On Wed, 06 Jul 2011 12:56:21 +0100, Stuart Dallas wrote:
> My guess is that the preceding $ causes PHP to interpret the next token
> "{XYZ}" as a variable or a constant, but without that preceding $ it has
> no way to know you're trying to use a constant. As Curtis points out,
> the only way to ins
>> Any ideas?
>>
>echo XYZ . "\n";
>
>
>
>--Curtis
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
Which doesn't answer the original question Dave asked...
Thanks,
Ash
http://www.ashleysheridan.co.uk
--
Sent from my Android phone wit
On Wed, Jul 6, 2011 at 12:07 PM, Dave Wilson wrote:
> Hi all,
>
> OK. We all know that constants cannot be accessed directly via their name
> in double-quoted or heredoc strings. I knew this already but a read of
> the PHP manual got me thinking.
>
> The manual states that to get the $$ value of
On 7/6/2011 7:07 AM, Dave Wilson wrote:
Output - {XYZ}
Attempt 2:
Output - {{XYZ}}
No luck there. I did encounter one oddity though:
Output:
PHP Notice: Undefined variable: ABC in /home/wilsond/testScripts/l7.php
on line 3
Which appears to mean that PHP is able to pick up the value of the
Hi all,
OK. We all know that constants cannot be accessed directly via their name
in double-quoted or heredoc strings. I knew this already but a read of
the PHP manual got me thinking.
The manual states that to get the $$ value of a variable, the form
"{${var}}" should be used. Therefore, I wonde
13 matches
Mail list logo