{"id":578,"date":"2020-05-22T16:18:22","date_gmt":"2020-05-22T13:18:22","guid":{"rendered":"https:\/\/ek.oa.edu.ua\/Kukhta\/test3\/?p=578"},"modified":"2020-05-22T16:43:20","modified_gmt":"2020-05-22T13:43:20","slug":"zlyttia-ta-rozdilennia-masyviv-u-php","status":"publish","type":"post","link":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/zlyttia-ta-rozdilennia-masyviv-u-php\/","title":{"rendered":"\u0417\u043b\u0438\u0442\u0442\u044f \u0442\u0430 \u0440\u043e\u0437\u0434\u0456\u043b\u0435\u043d\u043d\u044f \u043c\u0430\u0441\u0438\u0432\u0456\u0432"},"content":{"rendered":"<p>\u042f\u043a\u0449\u043e \u0432\u0430\u043c \u043f\u043e\u0442\u0440\u0456\u0431\u043d\u043e \u0434\u043e\u0434\u0430\u0442\u0438 \u0432 \u043c\u0430\u0441\u0438\u0432 \u043a\u0456\u043b\u044c\u043a\u0430 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432 \u0456\u043d\u0448\u043e\u0433\u043e \u043c\u0430\u0441\u0438\u0432\u0443, \u0442\u043e \u0432\u0430\u043c \u0434\u043e\u043f\u043e\u043c\u043e\u0436\u0435 \u0444\u0443\u043d\u043a\u0446\u0456\u044f <code>array_slice<\/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\n$new_arr = array_slice($arr, 0, 2); \r\nprint_r($new_arr);\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\">Array ( [one] =&gt; PHP [two] =&gt; HTML )<\/pre>\n<p>\u041f\u0435\u0440\u0448\u0438\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0444\u0443\u043d\u043a\u0446\u0456\u0457 <code>array_slice<\/code> &#8211; \u0446\u0435 \u043d\u0430\u0437\u0432\u0430 \u0442\u043e\u0433\u043e \u043c\u0430\u0441\u0438\u0432\u0443, \u0437 \u044f\u043a\u043e\u0433\u043e \u0431\u0443\u0434\u0443\u0442\u044c \u0431\u0440\u0430\u0442\u0438\u0441\u044f \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0438; \u0434\u0440\u0443\u0433\u0438\u0439 &#8211; \u043f\u043e\u0447\u0430\u0442\u043a\u043e\u0432\u0438\u0439 \u043d\u043e\u043c\u0435\u0440 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0430 (\u0437 \u044f\u043a\u043e\u0433\u043e \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043f\u043e\u0447\u0438\u043d\u0430\u0442\u0438 \u0431\u0440\u0430\u0442\u0438 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0438); \u0442\u0440\u0435\u0442\u0456\u0439 &#8211; \u043a\u0456\u043b\u044c\u043a\u0456\u0441\u0442\u044c \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432 \u0432\u0438\u0431\u0456\u0440\u043a\u0438.<\/p>\n<p>\u0414\u043b\u044f \u0437&#8217;\u0454\u0434\u043d\u0430\u043d\u043d\u044f \u043c\u0430\u0441\u0438\u0432\u0456\u0432 \u0432 \u043e\u0434\u0438\u043d \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>array_merge<\/code>:<\/p>\n<pre class=\"prettyprint linenums\">&lt;?php\r\n$arr[1] = \"PHP\"; \r\n$arr[2] = \"HTML\"; \r\n$arr[3] = \"CSS\";\r\n\r\n$arr2[1] = \"PHOTOSHOP\"; \r\n$arr2[2] = \"PAINT.NET\"; \r\n$arr2[3] = \"DREAMWEAVER\";\r\n\r\n$new_arr = array_merge($arr, $arr2); \r\nprint_r($new_arr); \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\">Array ( [0] =&gt; PHP [1] =&gt; HTML [2] =&gt; CSS [3] =&gt; PHOTOSHOP [4] =&gt; PAINT.NET [5] =&gt; DREAMWEAVER )<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u042f\u043a\u0449\u043e \u0432\u0430\u043c \u043f\u043e\u0442\u0440\u0456\u0431\u043d\u043e \u0434\u043e\u0434\u0430\u0442\u0438 \u0432 \u043c\u0430\u0441\u0438\u0432 \u043a\u0456\u043b\u044c\u043a\u0430 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432 \u0456\u043d\u0448\u043e\u0433\u043e \u043c\u0430\u0441\u0438\u0432\u0443, \u0442\u043e \u0432\u0430\u043c \u0434\u043e\u043f\u043e\u043c\u043e\u0436\u0435 \u0444\u0443\u043d\u043a\u0446\u0456\u044f array_slice: &lt;?php $arr[&#8220;one&#8221;] = &#8220;PHP&#8221;; $arr[&#8220;two&#8221;] = &#8220;HTML&#8221;; $arr[&#8220;three&#8221;] = &#8220;CSS&#8221;; $new_arr = array_slice($arr, 0, 2); print_r($new_arr); ?&gt; \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0456: Array ( [one] =&gt; PHP [two] =&gt; HTML ) \u041f\u0435\u0440\u0448\u0438\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0444\u0443\u043d\u043a\u0446\u0456\u0457 array_slice &#8211; \u0446\u0435 \u043d\u0430\u0437\u0432\u0430 \u0442\u043e\u0433\u043e \u043c\u0430\u0441\u0438\u0432\u0443, \u0437 \u044f\u043a\u043e\u0433\u043e [&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-578","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\/578","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=578"}],"version-history":[{"count":2,"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/posts\/578\/revisions"}],"predecessor-version":[{"id":584,"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/posts\/578\/revisions\/584"}],"wp:attachment":[{"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/media?parent=578"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/categories?post=578"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/tags?post=578"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}