This forum is now read-only. Please use our new forums at

Control Flow: Switch Forum

View Course » View Exercise

726 points
Submitted by
Milos Vranic
over 4 years ago

Is there any difference between ' ' and " "?

As far as I can see its all the same when i am writing or am I mistaking?

1 vote


What Milos meant was, " I know it has a difference, I just don't know what".

You will use " " when you are using strings (text) and you do not want the text between the " " to be taken literal.

When you use ' ' you are telling php to take whatever you put between the ' ' literally (like a location to a file on your server)

144 points
Submitted by
over 4 years ago

0 votes


basically within single quotes php will display it exactly as it is typed.
echo 'my name is $name'; will print

my name is $name

but if you put it in double quotes php will evaluate the variable and display the value:
echo "My name is $name";


My name is Bret

436 points
Submitted by
Bret Wagner
over 2 years ago

-18 votes


There is huge difference google it

22 points
Submitted by
over 4 years ago


3eec9e54bd3f1602589d3416889bcf36?s=140&d=retro Milos Vranic over 4 years ago

if you could explain it to me instead of being rude?

52598d50abf821b816004d5c_303815619 Ndrom over 4 years ago

im sorry, im new php to but i know there is huge difference