{"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\/ru\/programing\/php\/xml-php","title":{"rendered":"XML -> PHP"},"content":{"rendered":"<p>\u042d\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043f\u043e\u0441\u0442 \u0430 \u0442\u0430\u043a \u043f\u0440\u0438\u043c\u0435\u0442\u043a\u0430 \u0434\u043b\u044f \u0441\u0435\u0431\u044f, \u0447\u0442\u043e \u0431\u044b \u043d\u0435 \u0437\u0430\u0431\u044b\u043b<\/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>\u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u0441 \u0440\u0430\u0441\u0444\u0430\u0441\u043e\u0432\u0430\u043d\u043d\u044b\u043c xml. \u0412\u043e\u0442 \u0442\u0430\u043a \u0441\u0443\u043f\u0435\u0440 \u043f\u0440\u043e\u0441\u0442\u043e \u0438 \u0441\u0443\u043f\u0435\u0440 \u0443\u0434\u043e\u0431\u043d\u043e.<br \/>\n\u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 php5 \u0438 \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044f \u043f\u043e\u043d\u044f\u043b \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u0434\u0443\u043b\u044c, \u043d\u0443 \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u0448\u043b\u043e \u0431\u0435\u0437 \u0448\u0430\u043c\u0430\u043d\u0441\u0442\u0432\u0430. \u0415\u0441\u043b\u0438 \u0447\u0442\u043e \u043d\u0435 \u0442\u0430\u043a \u0442\u043e \u043f\u0443\u0442\u044c \u0432 \u0444\u0430\u0439\u043b php.ini<br \/>\n\u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043d\u0435\u0445\u0438\u0442\u0440\u044b\u0439 \u0444\u0430\u0439\u043b<\/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>\u041d\u0430 \u044d\u043a\u0440\u0430\u043d \u043f\u043e\u043b\u0443\u0447\u0438\u043c<\/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>\u041c\u043e\u0435 \u043c\u043d\u0435\u043d\u0438\u0435, \u044d\u0442\u043e \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u043a\u0442\u043e \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442 \u043f\u0440\u043e\u0449\u0435 \u0432\u044b\u0441\u043b\u0443\u0448\u0430\u044e.<br \/>\n<\/p>","protected":false},"excerpt":{"rendered":"<p>\u042d\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043f\u043e\u0441\u0442 \u0430 \u0442\u0430\u043a \u043f\u0440\u0438\u043c\u0435\u0442\u043a\u0430 \u0434\u043b\u044f \u0441\u0435\u0431\u044f, \u0447\u0442\u043e \u0431\u044b \u043d\u0435 \u0437\u0430\u0431\u044b\u043b simplexml_load_file(&quot;file.xml&quot;); simplexml_load_string($xml_string); \u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u0441 \u0440\u0430\u0441\u0444\u0430\u0441\u043e\u0432\u0430\u043d\u043d\u044b\u043c xml. \u0412\u043e\u0442 \u0442\u0430\u043a \u0441\u0443\u043f\u0435\u0440 \u043f\u0440\u043e\u0441\u0442\u043e \u0438 \u0441\u0443\u043f\u0435\u0440 \u0443\u0434\u043e\u0431\u043d\u043e. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 php5 \u0438 \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044f \u043f\u043e\u043d\u044f\u043b \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u0434\u0443\u043b\u044c, \u043d\u0443 \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u0448\u043b\u043e \u0431\u0435\u0437 \u0448\u0430\u043c\u0430\u043d\u0441\u0442\u0432\u0430. \u0415\u0441\u043b\u0438 \u0447\u0442\u043e \u043d\u0435 \u0442\u0430\u043a &hellip; <a href=\"https:\/\/uw-t.com\/ru\/programing\/php\/xml-php\" class=\"more-link\">\u0427\u0438\u0442\u0430\u0442\u044c \u0434\u0430\u043b\u0435\u0435 <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\/ru\/wp-json\/wp\/v2\/posts\/156","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/uw-t.com\/ru\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/uw-t.com\/ru\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/uw-t.com\/ru\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/uw-t.com\/ru\/wp-json\/wp\/v2\/comments?post=156"}],"version-history":[{"count":5,"href":"https:\/\/uw-t.com\/ru\/wp-json\/wp\/v2\/posts\/156\/revisions"}],"predecessor-version":[{"id":161,"href":"https:\/\/uw-t.com\/ru\/wp-json\/wp\/v2\/posts\/156\/revisions\/161"}],"wp:attachment":[{"href":"https:\/\/uw-t.com\/ru\/wp-json\/wp\/v2\/media?parent=156"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/uw-t.com\/ru\/wp-json\/wp\/v2\/categories?post=156"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/uw-t.com\/ru\/wp-json\/wp\/v2\/tags?post=156"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}