[FX.php List] Stumbled on something I hadn't realized...

Steve Winter steve at bluecrocodile.co.nz
Thu Nov 13 12:15:48 MST 2008


Hi Bob,

That works so long as you use " " in your echo statement not ' '

$name = "Bob";
echo "Hello $name"; // echos Hello Bob
echo 'Hello $name'; // echos Hello $name

Cheers
Steve

On 13 Nov 2008, at 19:11, Bob Patin wrote:

> I didn't realize that in PHP you can write
>
> <?php
>
> $string = "Bob";
>
> echo "$string needs to read up on PHP.";
>
> ?>
>
> I've been writing this:
>
> echo $string." needs to read up on PHP.";
>
> It never occurred to me to that you could put variables inside  
> quotes like that and that they'd be echoed back rather than  
> displayed as text...
>
> I've been writing things the hard way all this time... sheesh...
>
> Hopefully this will save someone else some time...
>
> Bob Patin
> Longterm Solutions LLC
> bob at longtermsolutions.com
> 615-333-6858
> http://www.longtermsolutions.com
> iChat/AIM: bobpatin
> FileMaker 9 Certified Developer
> Member of FileMaker Business Alliance
> --------------------------
> FileMaker hosting and consulting for all versions of FileMaker
> PHP • Full email services • Free DNS hosting • Colocation • Consulting
>
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list




More information about the FX.php_List mailing list