{"id":576,"date":"2020-05-22T16:12:00","date_gmt":"2020-05-22T13:12:00","guid":{"rendered":"https:\/\/ek.oa.edu.ua\/Kukhta\/test3\/?p=576"},"modified":"2020-05-22T16:43:29","modified_gmt":"2020-05-22T13:43:29","slug":"vytiahannia-zminnykh-z-masyviv-v-php","status":"publish","type":"post","link":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/vytiahannia-zminnykh-z-masyviv-v-php\/","title":{"rendered":"\u0412\u0438\u0442\u044f\u0433\u0430\u043d\u043d\u044f \u0437\u043c\u0456\u043d\u043d\u0438\u0445 \u0437 \u043c\u0430\u0441\u0438\u0432\u0456\u0432"},"content":{"rendered":"<p>\u042f\u043a\u0449\u043e \u0454 \u043f\u043e\u0442\u0440\u0435\u0431\u0430 \u0434\u043b\u044f \u043c\u0430\u0441\u0438\u0432\u0443, \u044f\u043a\u0438\u0439 \u043f\u0440\u043e\u0456\u043d\u0434\u0435\u043a\u0441\u043e\u0432\u0430\u043d\u0438\u0439 \u043c\u0430\u043b\u0438\u043c\u0438 \u0434\u0430\u043d\u0438\u043c\u0438, \u043f\u0440\u0438\u0441\u0432\u043e\u0457\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f \u0437\u043c\u0456\u043d\u043d\u0438\u043c, \u043e\u0434\u043d\u043e\u0439\u043c\u0435\u043d\u043d\u0438\u043c \u0437 \u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u043d\u0438\u043c\u0438 \u0456\u043d\u0434\u0435\u043a\u0441\u0430\u043c\u0438, \u0442\u043e \u043c\u043e\u0436\u043d\u0430 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0432\u0430\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0456\u044e <code>extract<\/code>.<\/p>\n<pre class=\"prettyprint linenums\">&lt;?php\r\n$arr[\"one\"] = \"PHP\"; \r\n$arr[\"two\"] = \"HTML\"; \r\n$arr[\"three\"] = \"CSS\";\r\n\r\nextract(<span class=\"hljs-variable\">$arr<\/span>); \r\n\r\necho \"\\$one = $one &lt;br&gt;\";\r\necho \"\\$two = $two &lt;br&gt;\";\r\necho \"\\$three = $three &lt;br&gt;\"; \r\n?&gt;<\/pre>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0456:<\/p>\n<pre class=\"result\">$one = PHP\r\n$two = HTML\r\n$three = CSS<\/pre>\n<p>\u042f\u043a\u0449\u043e \u043f\u043e\u0442\u0440\u0456\u0431\u043d\u043e \u0441\u043a\u043b\u0430\u0441\u0442\u0438 \u0437\u0456 \u0437\u043c\u0456\u043d\u043d\u0438\u0445 \u043c\u0430\u0441\u0438\u0432, \u0442\u043e \u043f\u043e\u0442\u0440\u0456\u0431\u043d\u043e \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0432\u0430\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0456\u044e <code>compact<\/code>.<\/p>\n<pre class=\"prettyprint linenums\">&lt;?php\r\n$one = \"PHP\";\r\n$two = \"HTML\";\r\n$three = \"CSS\";\r\n\r\n<span class=\"hljs-variable\">$arr<\/span> = compact(<span class=\"hljs-string\">\"one\"<\/span>, <span class=\"hljs-string\">\"two\"<\/span>, <span class=\"hljs-string\">\"three\"<\/span>);\r\n\r\nprint_r(<span class=\"hljs-variable\">$arr<\/span>);\r\n<span class=\"hljs-preprocessor\">?&gt;<\/span><\/pre>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0456:<\/p>\n<pre class=\"result\">Array ( [one] =&gt; PHP [two] =&gt; HTML [three] =&gt; CSS )<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u042f\u043a\u0449\u043e \u0454 \u043f\u043e\u0442\u0440\u0435\u0431\u0430 \u0434\u043b\u044f \u043c\u0430\u0441\u0438\u0432\u0443, \u044f\u043a\u0438\u0439 \u043f\u0440\u043e\u0456\u043d\u0434\u0435\u043a\u0441\u043e\u0432\u0430\u043d\u0438\u0439 \u043c\u0430\u043b\u0438\u043c\u0438 \u0434\u0430\u043d\u0438\u043c\u0438, \u043f\u0440\u0438\u0441\u0432\u043e\u0457\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f \u0437\u043c\u0456\u043d\u043d\u0438\u043c, \u043e\u0434\u043d\u043e\u0439\u043c\u0435\u043d\u043d\u0438\u043c \u0437 \u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u043d\u0438\u043c\u0438 \u0456\u043d\u0434\u0435\u043a\u0441\u0430\u043c\u0438, \u0442\u043e \u043c\u043e\u0436\u043d\u0430 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0432\u0430\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0456\u044e extract. &lt;?php $arr[&#8220;one&#8221;] = &#8220;PHP&#8221;; $arr[&#8220;two&#8221;] = &#8220;HTML&#8221;; $arr[&#8220;three&#8221;] = &#8220;CSS&#8221;; extract($arr); echo &#8220;\\$one = $one &lt;br&gt;&#8221;; echo &#8220;\\$two = $two &lt;br&gt;&#8221;; echo &#8220;\\$three = $three &lt;br&gt;&#8221;; ?&gt; \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0456: $one = PHP $two [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[],"class_list":["post-576","post","type-post","status-publish","format-standard","hentry","category-massyvy"],"_links":{"self":[{"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/posts\/576","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/comments?post=576"}],"version-history":[{"count":2,"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/posts\/576\/revisions"}],"predecessor-version":[{"id":585,"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/posts\/576\/revisions\/585"}],"wp:attachment":[{"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/media?parent=576"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/categories?post=576"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/tags?post=576"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}