{"id":156,"date":"2011-06-03T07:05:03","date_gmt":"2011-06-03T05:05:03","guid":{"rendered":"http:\/\/my-opinions.info\/?p=156"},"modified":"2011-06-03T07:05:03","modified_gmt":"2011-06-03T05:05:03","slug":"xml-php","status":"publish","type":"post","link":"https:\/\/uw-t.com\/en\/programing\/php\/xml-php","title":{"rendered":"XML -> PHP"},"content":{"rendered":"<p>It's no longer the post as well primetka for myself that would not have forgotten <\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">simplexml_load_file(&quot;file.xml&quot;);\r\nsimplexml_load_string($xml_string);\r\n<\/pre>\n<p>At output you get an object with a pre-packaged xml. That's super easy and super convenient.<br \/>\nThe only thing that should probably be noted that this method requires php5 and I understand some module, well, I have gone without a shaman. If that is not the path to the php.ini file<br \/>\nFor example, you can write here is a simple file <\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n$xml=&quot;&lt;request&gt;      \r\n&lt;version&gt;1.2&lt;\/version&gt;\r\n&lt;result_url&gt;http:\/\/ulove.ua\/\/buy\/&lt;\/result_url&gt;\r\n&lt;server_url&gt;http:\/\/ulove.ua\/\/buy\/resultliqpay\/&lt;\/server_url&gt;\r\n&lt;merchant_id&gt;i4927007979&lt;\/merchant_id&gt;\r\n&lt;order_id&gt;128&lt;\/order_id&gt;\r\n&lt;amount&gt;12&lt;\/amount&gt;\r\n&lt;currency&gt;USD&lt;\/currency&gt;\r\n&lt;description&gt;uLove&lt;\/description&gt;\r\n&lt;default_phone&gt;+380938729936&lt;\/default_phone&gt;\r\n&lt;pay_way&gt;card&lt;\/pay_way&gt; \r\n&lt;\/request&gt;&quot;;\r\n$xml=simplexml_load_string($xml);\r\nprint_r($xml);\r\necho $xml-&gt;order_id;\r\n<\/pre>\n<p>On the screen we <\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\nSimpleXMLElement Object\r\n(\r\n    &#x5B;version] =&gt; 1.2\r\n    &#x5B;result_url] =&gt; http:\/\/ulove.ua\/\/buy\/\r\n    &#x5B;server_url] =&gt; http:\/\/ulove.ua\/\/buy\/resultliqpay\/\r\n    &#x5B;merchant_id] =&gt; i4927007979\r\n    &#x5B;order_id] =&gt; 128\r\n    &#x5B;amount] =&gt; 12\r\n    &#x5B;currency] =&gt; USD\r\n    &#x5B;description] =&gt; uLove\r\n    &#x5B;default_phone] =&gt; +380938729936\r\n    &#x5B;pay_way] =&gt; card\r\n)\r\n128\r\n<\/pre>\n<p>My opinion, this is the easiest option, who will offer easier listen.<br \/>\n<\/p>","protected":false},"excerpt":{"rendered":"<p>It's no longer the post as well primetka for myself that would not have forgotten simplexml_load_file(&quot;file.xml&quot;); simplexml_load_string($xml_string); At output you get an object with a pre-packaged xml. That's super easy and super convenient. The only thing that should probably be noted that this method requires php5 and I understand some module, well, I have gone &hellip; <a href=\"https:\/\/uw-t.com\/en\/programing\/php\/xml-php\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">XML -> PHP<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[7],"tags":[25,23,24],"class_list":["post-156","post","type-post","status-publish","format-standard","hentry","category-php","tag-object-xml","tag-php-2","tag-xml"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/uw-t.com\/en\/wp-json\/wp\/v2\/posts\/156","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/uw-t.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/uw-t.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/uw-t.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/uw-t.com\/en\/wp-json\/wp\/v2\/comments?post=156"}],"version-history":[{"count":5,"href":"https:\/\/uw-t.com\/en\/wp-json\/wp\/v2\/posts\/156\/revisions"}],"predecessor-version":[{"id":161,"href":"https:\/\/uw-t.com\/en\/wp-json\/wp\/v2\/posts\/156\/revisions\/161"}],"wp:attachment":[{"href":"https:\/\/uw-t.com\/en\/wp-json\/wp\/v2\/media?parent=156"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/uw-t.com\/en\/wp-json\/wp\/v2\/categories?post=156"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/uw-t.com\/en\/wp-json\/wp\/v2\/tags?post=156"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}