{"id":34,"date":"2009-08-02T19:59:00","date_gmt":"2009-08-02T19:59:00","guid":{"rendered":"http:\/\/www.codeboss.in\/web-funda\/?p=34"},"modified":"2009-08-02T19:59:00","modified_gmt":"2009-08-02T19:59:00","slug":"php-single-and-double-quote-difference","status":"publish","type":"post","link":"https:\/\/codeboss.in\/web-funda\/2009\/08\/02\/php-single-and-double-quote-difference\/","title":{"rendered":"PHP :: Single And Double Quote Difference"},"content":{"rendered":"<p>We all use plenty of &#8216; {single quote} and &#8221; {double quote} in our PHP code. As a beginner a lot of us use them without knowing the difference and use it according to our personal choice. The confusion starts to build up when we start using variables. And a lot of time is lost in debugging what is going wrong.<\/p>\n<p>In short the difference between them is &#8211;<\/p>\n<p><span style=\"font-weight:bold;\">Single Quote &#8211; It shows the output as entered in the script<\/span><\/p>\n<p><span style=\"font-weight:bold;\">Double Quote &#8211; It parses variables and special characters written within<\/span><\/p>\n<p>To make things clear with an example<\/p>\n<pre class=\"brush: php;\"><br \/>$ask = 'Question';<br \/><br \/>echo 'Ask the $ask'; \/\/\/ prints - Ask the $ask<br \/><br \/>echo \"Ask the $ask\"; \/\/\/ prints - Ask the Question<br \/><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>We all use plenty of &#8216; {single quote} and &#8221; {double quote} in our PHP code. As a beginner a lot of us use them without knowing the difference and use it according to our personal choice. The confusion starts to build up when we start using variables. And a lot of time is lost&hellip; <a class=\"more-link\" href=\"https:\/\/codeboss.in\/web-funda\/2009\/08\/02\/php-single-and-double-quote-difference\/\">Continue reading <span class=\"screen-reader-text\">PHP :: Single And Double Quote Difference<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[57],"class_list":["post-34","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-php","entry"],"_links":{"self":[{"href":"https:\/\/codeboss.in\/web-funda\/wp-json\/wp\/v2\/posts\/34","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codeboss.in\/web-funda\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codeboss.in\/web-funda\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codeboss.in\/web-funda\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codeboss.in\/web-funda\/wp-json\/wp\/v2\/comments?post=34"}],"version-history":[{"count":0,"href":"https:\/\/codeboss.in\/web-funda\/wp-json\/wp\/v2\/posts\/34\/revisions"}],"wp:attachment":[{"href":"https:\/\/codeboss.in\/web-funda\/wp-json\/wp\/v2\/media?parent=34"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codeboss.in\/web-funda\/wp-json\/wp\/v2\/categories?post=34"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codeboss.in\/web-funda\/wp-json\/wp\/v2\/tags?post=34"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}