answersLogoWhite

0


Best Answer

There's not too much of a difference. Most people prefer using double quotes because of the fact that you can do this: <?php $var2 = "Look at {$var1}!"; ?> which you can't do the {} thing with single quotes. You would have to do <?php $var = 'Look at '.$var1.'!'; ?>

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

in PHP, using double quotes (") you can still use variables in the string. This is considerably slower than using single quotes (')


example:


echo "Hello $name";

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the difference between single quotes and double quotes in PHP?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the difference between single quotes and double quotes?

in programming, single quotes are for characters, and double quotes are for string, but in php, javascript, html, css i don't see any difference between the two.


Can you use both single quotes and double quotes for strings in php?

Yes, you can use both single quotes (' ') and double quotes (&quot; &quot;) for defining strings in PHP. However, the choice between single and double quotes depends on whether you need to include variables or special characters within the string. Single quotes treat everything as a literal string, while double quotes allow for variable interpolation and escape sequences.


Do single-quoted string literals have any characteristics difference from those of double-quoted string literals?

The literals with single quotes are Characters and can have a width of only one. Ex: 'y' or 'a' etc Strings cannot be declared using single quotes. They have to be declared with double quotes.


In linux What is the difference between single quotes and double quotes with respect to shell interpretation?

Double quotes allow changes to the text string, including: -- substitution for variable names, such as $x; -- expansion of special characters, such as '*' or '?' within file names; -- command execution within backticks, such as "You have `ls | wc -l` files" Single quotes enclose an explict string, and prevent most of these changes.


What is different between double layer media and a single layer media?

difference between single layer and double winding


What is the difference between single and double screw threads?

screw thread are single threads which means they are not double


What is the difference between single cell and double cell blinds?

No


What is the difference between single replacement and double replacement?

a single replacement has one product and the double replacement has two products.


Difference between the DNA and RNA?

the difference is that DNA is a double helix and RNA is a single chain


What is the difference between single and double pithing?

single destroys the brain and double destroys the spinal cord or central nervous system


Why are double quotes used in C programming?

In C programming, double quotes are used to indicate String literal. char *s = "Hello World"; Where as single quotes are used to indicate a single character. char x = 'a';


What is the difference between a twin and double hotel room?

A twin bedroom has two single beds, a double bedroom has a double bed!