{"id":196,"date":"2021-12-28T19:05:08","date_gmt":"2021-12-28T19:05:08","guid":{"rendered":"https:\/\/mouryasolutions.in\/blog\/?p=196"},"modified":"2023-01-30T19:48:16","modified_gmt":"2023-01-30T19:48:16","slug":"convert-json-to-php","status":"publish","type":"post","link":"https:\/\/mouryasolutions.in\/blog\/convert-json-to-php\/","title":{"rendered":"How to convert json string into Php"},"content":{"rendered":"<div class=\"post-content\">\r\n<blockquote class=\"wp-block-quote\">\r\n<p>You can convert a JSON string to a PHP array using the &#8216;<code>json_decode<\/code>&#8216; function:<\/p>\r\n<\/blockquote>\r\n\r\n\r\n\r\n<pre class=\"wp-block-code\"><code>$json = '{\"name\":\"John Doe\",\"age\":32,\"city\":\"New York\"}';\r\n\r\n$array = json_decode($json, true);\r\n\r\nprint_r($array);\r\n<\/code><\/pre>\r\n\r\n\r\n\r\n<p>The second argument <code>true<\/code> of <code>json_decode<\/code> function specifies that the function should return an associative array instead of an object.<\/p>\r\n<\/div>","protected":false},"excerpt":{"rendered":"<p>You can convert a JSON string to a PHP array<a href=\"https:\/\/mouryasolutions.in\/blog\/convert-json-to-php\/\">Read More<i class=\"fa fa-long-arrow-right\" aria-hidden=\"true\"><\/i><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[10],"tags":[],"_links":{"self":[{"href":"https:\/\/mouryasolutions.in\/blog\/wp-json\/wp\/v2\/posts\/196"}],"collection":[{"href":"https:\/\/mouryasolutions.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mouryasolutions.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mouryasolutions.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mouryasolutions.in\/blog\/wp-json\/wp\/v2\/comments?post=196"}],"version-history":[{"count":12,"href":"https:\/\/mouryasolutions.in\/blog\/wp-json\/wp\/v2\/posts\/196\/revisions"}],"predecessor-version":[{"id":473,"href":"https:\/\/mouryasolutions.in\/blog\/wp-json\/wp\/v2\/posts\/196\/revisions\/473"}],"wp:attachment":[{"href":"https:\/\/mouryasolutions.in\/blog\/wp-json\/wp\/v2\/media?parent=196"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mouryasolutions.in\/blog\/wp-json\/wp\/v2\/categories?post=196"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mouryasolutions.in\/blog\/wp-json\/wp\/v2\/tags?post=196"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}