NYCPHP Meetup

NYPHP.org

[nycphp-talk] single quote vs. double quote

David Krings ramons at gmx.net
Mon Apr 2 21:16:38 EDT 2007


Hi!

The old topic is at it again. After some long long time I started again 
with doing some PHP. Task: internationalize my existing project. Goal: 
read strings from a text file. First step: open the file.

I used this:
$langfile = fopen('$langfileloc', 'r');
and constantly had it fail. The path and file name are OK, I 
quadruplechecked.

Now, when I do this:
$langfile = fopen("$langfileloc", "r");
It works like a charm. Which makes me wonder as some long time ago we 
had this nice discussion that ended with sth like "one needs only the 
single quote for everything in PHP".

Do I recall this incorrectly or are the exceptions (bugs?) in PHP?

Well, took me quite some time to figure out that my use of expert advise 
wasn't that great this time around.

David



More information about the talk mailing list