{"id":1564,"date":"2011-03-08T22:50:52","date_gmt":"2011-03-08T22:50:52","guid":{"rendered":"http:\/\/www.codingfriends.com\/?p=1564"},"modified":"2011-03-08T22:50:52","modified_gmt":"2011-03-08T22:50:52","slug":"curly-brackets","status":"publish","type":"post","link":"https:\/\/www.codingfriends.com\/index.php\/2011\/03\/08\/curly-brackets\/","title":{"rendered":"Curly brackets"},"content":{"rendered":"<p>It all depends on your type of coding, but I for style I do prefer to put array data within a separate part of the echo statement, for example.<\/p>\n<pre lang=\"php\">\r\n$arr = array(\"first\" => 1, \"second\" =>2);\r\n\r\necho \"this is the first value \" . $arr[\"first\"];\r\n<\/pre>\n<p>but of course you can put the arr object within the echo statement as long as you { .. } it out, which is kinder similar to using the &#8221; . as such, <\/p>\n<pre lang=\"php\">\r\necho \"this is the second value {$arr[\"second\"]}\";\r\n<\/pre>\n<p>both work, but because of the array object uses the &#8220;..&#8221; for the hash key, then you will need to use the { .. }<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It all depends on your type of coding, but I for style I do prefer to put array data within a separate part of the echo statement, for example. $arr = array(&#8220;first&#8221; => 1, &#8220;second&#8221; =>2); echo &#8220;this is the first value &#8221; . $arr[&#8220;first&#8221;]; but of course you can put the arr object within &hellip; <a href=\"https:\/\/www.codingfriends.com\/index.php\/2011\/03\/08\/curly-brackets\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Curly brackets<\/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":[17],"tags":[329],"class_list":["post-1564","post","type-post","status-publish","format-standard","hentry","category-php","tag-curly-brackets"],"_links":{"self":[{"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/posts\/1564","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/comments?post=1564"}],"version-history":[{"count":1,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/posts\/1564\/revisions"}],"predecessor-version":[{"id":1565,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/posts\/1564\/revisions\/1565"}],"wp:attachment":[{"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/media?parent=1564"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/categories?post=1564"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/tags?post=1564"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}