EY Posted March 12, 2008 Share Posted March 12, 2008 Can someone please explain me the difference with some examples please. I have been reading my php book examples but i still do not understand and was hoping to get help on that here. Thanks. Link to comment https://forums.phpfreaks.com/topic/95851-using-single-and-double-quotes-with-strings/ Share on other sites More sharing options...
revraz Posted March 12, 2008 Share Posted March 12, 2008 Double Quotes parses variables and displays what they contain, Single Quotes will do a literal display. Link to comment https://forums.phpfreaks.com/topic/95851-using-single-and-double-quotes-with-strings/#findComment-490699 Share on other sites More sharing options...
EY Posted March 12, 2008 Author Share Posted March 12, 2008 What are literal display? Link to comment https://forums.phpfreaks.com/topic/95851-using-single-and-double-quotes-with-strings/#findComment-490700 Share on other sites More sharing options...
p2grace Posted March 12, 2008 Share Posted March 12, 2008 The biggest difference is that you can only use variables inside of strings if the string in inside of double quotes. Example: <?php $var = "Hello"; // Won't Work echo '$var'; // will display $var // Will Work echo "$var"; // will display Hello ?> Simple example, let me know if you need further details. Link to comment https://forums.phpfreaks.com/topic/95851-using-single-and-double-quotes-with-strings/#findComment-490702 Share on other sites More sharing options...
EY Posted March 12, 2008 Author Share Posted March 12, 2008 Alright thanks very much. I understand now!! Link to comment https://forums.phpfreaks.com/topic/95851-using-single-and-double-quotes-with-strings/#findComment-490705 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.