Questions for new php users. A few simple questions. 1. what is the difference between single quotes and double quotes in php. 2. php variables & nbsp; $ str & quot; aa $ C & quot; & nbsp; and $ str & quot; aa & quot ;. $ C is not just two different writing methods. ------ solution -------------------- 1. strings in single quotes are not replaced with variables or escaped characters. New php users ask a few simple questions.
1. what is the difference between single quotes and double quotes in php.
2. php variables $ str = "aa $ C" and $ str = "aa". $ C are just two different methods.
------ Solution --------------------
1. Strings in single quotes are not replaced with variables or escaped characters. Double quotation marks replace variables and escape special characters.
2. yes
------ Solution --------------------
Upstairs
Positive solution: Use points to make your program more readable.
------ Solution --------------------
Same as above
------ Solution --------------------
Test it with a program and you will understand everything.
------ Solution --------------------
Variables in double quotation marks are parsed. No single quotation marks (output as is ).
------ Solution --------------------
Learning
------ Solution --------------------
Variables can be placed in double quotation marks, but not in single quotation marks. '$ str' will output $ str. because PHP considers that the single quotation mark is a string rather than a variable.
---------------------------------
In fact, there are only a lot of things in this regard. you enter "What is the difference between single quotes and double quotes" in the google text box in www.google.com, and you will find the answer you need. Thank you!
------ Solution --------------------
Single quotes are highly efficient and support single quotes
------ Solution --------------------
You put the variables in them separately, and then output them.