NYCPHP Meetup

NYPHP.org

[nycphp-talk] Whats the difference between an apostrophe and a quotation

Guilherme Blanco guilhermeblanco at gmail.com
Sat Jan 12 12:06:29 EST 2008


There are 3 types of quotes.

$var = 'test';

Single quotes: Not parsed by PHP compiler...

echo 'Some $var'; // Will print: Some $var

Double quotes: Parsed by compiler...

echo "Some $var"; // Will print: Some test

Backtick: Processed by console

echo `ps -aux`; // Will print running processes



I hope this info helps you...


Regards,




On Jan 12, 2008 2:13 PM, tedd <tedd at sperling.com> wrote:
> At 12:44 AM +0200 1/12/08, Jonathan Wagener wrote:
> >Hi, whats the difference between an apostrophe and a quotation in php?
>
> What's the difference?
>
> "This $string is evaluated by the compiler"
>
> 'and this $string isn't'
>
> Cheers,
>
> tedd
>
> --
> -------
> http://sperling.com  http://ancientstones.com  http://earthstones.com
>
> _______________________________________________
> New York PHP Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> NYPHPCon 2006 Presentations Online
> http://www.nyphpcon.com
>
> Show Your Participation in New York PHP
> http://www.nyphp.org/show_participation.php
>



-- 
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: guilhermeblanco at hotmail.com
URL: http://blog.bisna.com
São Carlos - SP/Brazil


More information about the talk mailing list