PDA

View Full Version : PHP question, " ' - what is the difference?



ben22
January 30th, 2008, 02:48 PM
Hi,

I was wondering whether someone knows a good php forum to exchange with other developers.


Also one question. I read a tutorial and sometimes the author is using ' - sometimes ".

What is the difference?

Example:

if(isset($_GET['section']) AND ("admin" == $_GET['section'])) {
session_start(); }


if(isset($_GET['section']) AND ('admin' == $_GET['section'])) {
session_start(); }

LaRoza
January 30th, 2008, 02:51 PM
Strings in double quotes do variable substitution.

idn
January 30th, 2008, 03:10 PM
just out of interest what does that mean? i didnt think there was a difference...

LaRoza
January 30th, 2008, 03:15 PM
just out of interest what does that mean? i didnt think there was a difference...



$bestforummember = "LaRoza";

echo "$bestforummember is the best\n";

echo '$bestforummember is the best';


Output:


LaRoza is the best
$bestforummember is the best

ThinkBuntu
January 30th, 2008, 03:33 PM
Also, the \n indicating a newline and similar characters only work with double quotes. I generally use double quotes unless there's a reason not to.

LaRoza
January 30th, 2008, 03:36 PM
Also, the \n indicating a newline and similar characters only work with double quotes. I generally use double quotes unless there's a reason not to.

404 still. Hows it going?

ThinkBuntu
January 30th, 2008, 03:36 PM
So far, so good. Still due out by Feb. 14.

LaRoza
January 30th, 2008, 03:37 PM
So far, so good. Still due out by Feb. 14.

It better be. I keep getting requests for CSS issues and help.