{"id":694,"date":"2012-05-21T08:50:42","date_gmt":"2012-05-21T08:50:42","guid":{"rendered":"http:\/\/www.withinweb.com\/info\/?p=694"},"modified":"2012-05-22T15:06:45","modified_gmt":"2012-05-22T15:06:45","slug":"single-and-double-quotes-in-php","status":"publish","type":"post","link":"https:\/\/www.withinweb.com\/info\/single-and-double-quotes-in-php\/","title":{"rendered":"Single and double quotes in PHP"},"content":{"rendered":"<p>There is a difference in the way that PHP handles single and double quote marks when using the echo statement.<\/p>\n<p>For example :<\/p>\n<p><strong>$var = \u2018test\u2019;<\/strong><\/p>\n<p>The statements <strong>echo(&#8216;$var&#8217;); <\/strong>and <strong>echo(&#8220;$var&#8221;);<\/strong> will generate different results.<\/p>\n<p><strong>echo \u201c\\$var is equal to $var\u201d;<\/strong><\/p>\n<p>will display <strong>$var is equal to test<\/strong><\/p>\n<p>While :<\/p>\n<p><strong>echo \u2018\\$var is equal to $var\u2019;<\/strong><\/p>\n<p>will display<\/p>\n<p><strong>\\$var is equal to $var<\/strong><strong>.<\/strong><\/p>\n<p>In the case of the sinlle quotes, the variable name is displayed as is.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There is a difference in the way that PHP handles single and double quote marks when using the echo statement. For example : $var = \u2018test\u2019; The statements echo(&#8216;$var&#8217;); and echo(&#8220;$var&#8221;); will generate different results. echo \u201c\\$var is equal to<span class=\"ellipsis\">&hellip;<\/span><\/p>\n<div class=\"read-more\"><a href=\"https:\/\/www.withinweb.com\/info\/single-and-double-quotes-in-php\/\">Read more <span class=\"screen-reader-text\">Single and double quotes in PHP<\/span><span class=\"meta-nav\"> &#8250;<\/span><\/a><\/div>\n<p><!-- end of .read-more --><\/p>\n","protected":false},"author":40,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-694","post","type-post","status-publish","format-standard","hentry","category-general-php"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Single and double quotes in PHP - PHP Web Applications<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.withinweb.com\/info\/single-and-double-quotes-in-php\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Single and double quotes in PHP - PHP Web Applications\" \/>\n<meta property=\"og:description\" content=\"There is a difference in the way that PHP handles single and double quote marks when using the echo statement. For example : $var = \u2018test\u2019; The statements echo(&#8216;$var&#8217;); and echo(&#8220;$var&#8221;); will generate different results. echo \u201c$var is equal to&hellip;Read more Single and double quotes in PHP &#8250;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.withinweb.com\/info\/single-and-double-quotes-in-php\/\" \/>\n<meta property=\"og:site_name\" content=\"PHP Web Applications\" \/>\n<meta property=\"article:published_time\" content=\"2012-05-21T08:50:42+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2012-05-22T15:06:45+00:00\" \/>\n<meta name=\"author\" content=\"paulv\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"paulv\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/single-and-double-quotes-in-php\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/single-and-double-quotes-in-php\\\/\"},\"author\":{\"name\":\"paulv\",\"@id\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/#\\\/schema\\\/person\\\/04da5531c302d55ffcd777fe81dbb93c\"},\"headline\":\"Single and double quotes in PHP\",\"datePublished\":\"2012-05-21T08:50:42+00:00\",\"dateModified\":\"2012-05-22T15:06:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/single-and-double-quotes-in-php\\\/\"},\"wordCount\":82,\"commentCount\":0,\"articleSection\":[\"General PHP\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.withinweb.com\\\/info\\\/single-and-double-quotes-in-php\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/single-and-double-quotes-in-php\\\/\",\"url\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/single-and-double-quotes-in-php\\\/\",\"name\":\"Single and double quotes in PHP - PHP Web Applications\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/#website\"},\"datePublished\":\"2012-05-21T08:50:42+00:00\",\"dateModified\":\"2012-05-22T15:06:45+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/#\\\/schema\\\/person\\\/04da5531c302d55ffcd777fe81dbb93c\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/single-and-double-quotes-in-php\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.withinweb.com\\\/info\\\/single-and-double-quotes-in-php\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/single-and-double-quotes-in-php\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Single and double quotes in PHP\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/#website\",\"url\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/\",\"name\":\"PHP Web Applications\",\"description\":\"Information and support for products of WithinWeb.com\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/#\\\/schema\\\/person\\\/04da5531c302d55ffcd777fe81dbb93c\",\"name\":\"paulv\",\"url\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/author\\\/paulv\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Single and double quotes in PHP - PHP Web Applications","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.withinweb.com\/info\/single-and-double-quotes-in-php\/","og_locale":"en_US","og_type":"article","og_title":"Single and double quotes in PHP - PHP Web Applications","og_description":"There is a difference in the way that PHP handles single and double quote marks when using the echo statement. For example : $var = \u2018test\u2019; The statements echo(&#8216;$var&#8217;); and echo(&#8220;$var&#8221;); will generate different results. echo \u201c$var is equal to&hellip;Read more Single and double quotes in PHP &#8250;","og_url":"https:\/\/www.withinweb.com\/info\/single-and-double-quotes-in-php\/","og_site_name":"PHP Web Applications","article_published_time":"2012-05-21T08:50:42+00:00","article_modified_time":"2012-05-22T15:06:45+00:00","author":"paulv","twitter_card":"summary_large_image","twitter_misc":{"Written by":"paulv"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.withinweb.com\/info\/single-and-double-quotes-in-php\/#article","isPartOf":{"@id":"https:\/\/www.withinweb.com\/info\/single-and-double-quotes-in-php\/"},"author":{"name":"paulv","@id":"https:\/\/www.withinweb.com\/info\/#\/schema\/person\/04da5531c302d55ffcd777fe81dbb93c"},"headline":"Single and double quotes in PHP","datePublished":"2012-05-21T08:50:42+00:00","dateModified":"2012-05-22T15:06:45+00:00","mainEntityOfPage":{"@id":"https:\/\/www.withinweb.com\/info\/single-and-double-quotes-in-php\/"},"wordCount":82,"commentCount":0,"articleSection":["General PHP"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.withinweb.com\/info\/single-and-double-quotes-in-php\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.withinweb.com\/info\/single-and-double-quotes-in-php\/","url":"https:\/\/www.withinweb.com\/info\/single-and-double-quotes-in-php\/","name":"Single and double quotes in PHP - PHP Web Applications","isPartOf":{"@id":"https:\/\/www.withinweb.com\/info\/#website"},"datePublished":"2012-05-21T08:50:42+00:00","dateModified":"2012-05-22T15:06:45+00:00","author":{"@id":"https:\/\/www.withinweb.com\/info\/#\/schema\/person\/04da5531c302d55ffcd777fe81dbb93c"},"breadcrumb":{"@id":"https:\/\/www.withinweb.com\/info\/single-and-double-quotes-in-php\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.withinweb.com\/info\/single-and-double-quotes-in-php\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.withinweb.com\/info\/single-and-double-quotes-in-php\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.withinweb.com\/info\/"},{"@type":"ListItem","position":2,"name":"Single and double quotes in PHP"}]},{"@type":"WebSite","@id":"https:\/\/www.withinweb.com\/info\/#website","url":"https:\/\/www.withinweb.com\/info\/","name":"PHP Web Applications","description":"Information and support for products of WithinWeb.com","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.withinweb.com\/info\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.withinweb.com\/info\/#\/schema\/person\/04da5531c302d55ffcd777fe81dbb93c","name":"paulv","url":"https:\/\/www.withinweb.com\/info\/author\/paulv\/"}]}},"_links":{"self":[{"href":"https:\/\/www.withinweb.com\/info\/wp-json\/wp\/v2\/posts\/694","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.withinweb.com\/info\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.withinweb.com\/info\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.withinweb.com\/info\/wp-json\/wp\/v2\/users\/40"}],"replies":[{"embeddable":true,"href":"https:\/\/www.withinweb.com\/info\/wp-json\/wp\/v2\/comments?post=694"}],"version-history":[{"count":6,"href":"https:\/\/www.withinweb.com\/info\/wp-json\/wp\/v2\/posts\/694\/revisions"}],"predecessor-version":[{"id":704,"href":"https:\/\/www.withinweb.com\/info\/wp-json\/wp\/v2\/posts\/694\/revisions\/704"}],"wp:attachment":[{"href":"https:\/\/www.withinweb.com\/info\/wp-json\/wp\/v2\/media?parent=694"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.withinweb.com\/info\/wp-json\/wp\/v2\/categories?post=694"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.withinweb.com\/info\/wp-json\/wp\/v2\/tags?post=694"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}