NYCPHP Meetup

NYPHP.org

[nycphp-talk] Quick little question - variable interpolation

Analysis & Solutions danielc at analysisandsolutions.com
Thu Oct 17 16:01:48 EDT 2002


On Thu, Oct 17, 2002 at 03:35:42PM -0400, David Sklar wrote:
> 
> $one = 1;
> $two = "this string = $one and that is it";
> 
> Double quotes.

Just to make sure everything is clear to Adam:

Only strings inside double quotes get evaluated.  Strings inside single
quotes are taken literally.

So:

 $one = 1;
 $two = "this string = $one and that is it";
 echo $two;
 [results:  this string = 1 and that is it]

 $one = 1;
 $two = 'this string = $one and that is it';
 echo $two;
 [results:  this string = $one and that is it]

--Dan

-- 
               PHP classes that make web design easier
        SQL Solution  |   Layout Solution   |  Form Solution
    sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY     v: 718-854-0335     f: 718-854-0409



More information about the talk mailing list