{"id":558,"date":"2020-05-22T10:56:27","date_gmt":"2020-05-22T07:56:27","guid":{"rendered":"https:\/\/ek.oa.edu.ua\/Kukhta\/test3\/?p=558"},"modified":"2020-05-22T16:44:32","modified_gmt":"2020-05-22T13:44:32","slug":"stvorennia-masyviv-v-php","status":"publish","type":"post","link":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/stvorennia-masyviv-v-php\/","title":{"rendered":"\u0421\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u044f \u043c\u0430\u0441\u0438\u0432\u0456\u0432"},"content":{"rendered":"<p>\u041c\u0430\u0441\u0438\u0432 &#8211; \u0446\u0435 \u043d\u0430\u0431\u0456\u0440 \u0434\u0430\u043d\u0438\u0445, \u044f\u043a\u0456 \u043e\u0431&#8217;\u0454\u0434\u043d\u0430\u043d\u0456 \u043f\u0456\u0434 \u043e\u0434\u043d\u0438\u043c \u0456\u043c&#8217;\u044f\u043c. \u041c\u0430\u0441\u0438\u0432 \u0441\u043a\u043b\u0430\u0434\u0430\u0454\u0442\u044c\u0441\u044f \u0437 \u0434\u0435\u043a\u0456\u043b\u044c\u043a\u043e\u0445 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432, \u044f\u043a\u0456 \u043c\u0430\u044e\u0442\u044c \u0441\u0432\u0456\u0439 \u043f\u0435\u0432\u043d\u0438\u0439 \u0456\u043d\u0434\u0435\u043a\u0441.<\/p>\n<p>\u041c\u0430\u0441\u0438\u0432\u0438 \u0441\u0442\u0432\u043e\u0440\u044e\u044e\u0442\u044c\u0441\u044f \u0437\u0430 \u0434\u043e\u043f\u043e\u043c\u043e\u0433\u043e\u044e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u043f\u0440\u0438\u0441\u0432\u043e\u0454\u043d\u043d\u044f, \u0442\u0430\u043a \u0441\u0430\u043c\u043e \u044f\u043a \u0456 \u0437\u043c\u0456\u043d\u043d\u0430.<br \/>\n\u0406\u043c\u0435\u043d\u0430 \u043c\u0430\u0441\u0438\u0432\u0456\u0432 \u0440\u043e\u0437\u043f\u043e\u0447\u0438\u043d\u0430\u044e\u0442\u044c\u0441\u044f \u0437\u0456 \u0437\u043d\u0430\u043a\u0443 <strong>$<\/strong>, \u043f\u0456\u0441\u043b\u044f \u044f\u043a\u043e\u0433\u043e \u0441\u043b\u0456\u0434\u0443\u0454 \u0434\u043e\u0432\u0456\u043b\u044c\u043d\u0438\u0439 \u0456\u0434\u0435\u043d\u0442\u0438\u0444\u0456\u043a\u0430\u0442\u043e\u0440, \u0434\u0430\u043b\u0456 \u0439\u0434\u0443\u0442\u044c \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u0456 \u0434\u0443\u0436\u043a\u0438: <strong>$<\/strong>arr[0] = &#8220;php&#8221;;<\/p>\n<p>\u0426\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0456\u044f \u0441\u0442\u0432\u043e\u0440\u044e\u0454 \u043c\u0430\u0441\u0438\u0432 \u0456 \u043f\u0440\u0438\u0441\u0432\u043e\u044e\u0454 \u0439\u043e\u0433\u043e \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0443 \u0437 \u0456\u043d\u0434\u0435\u043a\u0441\u043e\u043c 0 \u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f &#8220;php&#8221;, \u043f\u0456\u0441\u043b\u044f \u0447\u043e\u0433\u043e \u043c\u0438 \u043c\u043e\u0436\u0435\u043c\u043e \u0437\u0432\u0435\u0440\u0442\u0430\u0442\u0438\u0441\u044f \u0434\u043e \u0446\u044c\u043e\u0433\u043e \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0443 \u044f\u043a \u0434\u043e \u0437\u0432\u0438\u0447\u0430\u0439\u043d\u043e\u0457 \u0437\u043c\u0456\u043d\u043d\u043e\u0457: <code>echo $arr[0]<\/code>. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0456 \u043c\u0438 \u043f\u043e\u0431\u0430\u0447\u0438\u043c\u043e \u0441\u043b\u043e\u0432\u043e <em>php<\/em>.<\/p>\n<p>\u0422\u0430\u043a\u043e\u0436, \u043c\u0438 \u043c\u043e\u0436\u0435\u043c\u043e \u0434\u043e\u0434\u0430\u0442\u0438 \u0449\u0435 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0438 \u0434\u043e \u043c\u0430\u0441\u0438\u0432\u0443:<\/p>\n<pre class=\"prettyprint linenums\">&lt;?php\r\n$arr[1] = \"html\";\r\n$arr[2] = \"css\";\r\n?&gt;<\/pre>\n<p>\u042f\u043a \u0456\u043d\u0434\u0435\u043a\u0441 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432 \u043c\u0430\u0441\u0438\u0432\u0443 \u043c\u0438 \u043c\u043e\u0436\u0435\u043c\u043e \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u0430\u0442\u0438 \u043d\u0435 \u043b\u0438\u0448\u0435 \u0447\u0438\u0441\u043b\u0430:<\/p>\n<pre class=\"prettyprint linenums\">&lt;?php\r\n$arr[\"Kiev\"] = 3000000; \r\n$arr[\"Paris\"] = 5000000; \r\n$arr[\"LA\"] = 15000000;\r\n?&gt;<\/pre>\n<p>\u0412 \u044f\u043a\u043e\u0441\u0442\u0456 \u0437\u043d\u0430\u0447\u0435\u043d\u044c \u0456\u043d\u0434\u0435\u043a\u0441\u0456\u0432 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432 \u0456 \u0441\u0430\u043c\u0438\u0445 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432 \u043c\u0438 \u043c\u043e\u0436\u0435\u043c\u043e \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u0430\u0442\u0438 \u043e\u0434\u043d\u0430\u043a\u043e\u0432\u0456 \u0442\u0438\u043f\u0438 \u0434\u0430\u043d\u0438\u0445 <strong>\u043e\u0434\u043d\u043e\u0447\u0430\u0441\u043d\u043e<\/strong>!<\/p>\n<p>\u0422\u0430\u043a\u043e\u0436 \u0456\u0441\u043d\u0443\u0454 \u0441\u043a\u043e\u0440\u043e\u0447\u0435\u043d\u0438\u0439 \u0437\u0430\u043f\u0438\u0441 \u0434\u043b\u044f \u0456\u043d\u0434\u0435\u043a\u0441\u0443\u0432\u0430\u043d\u043d\u044f:<\/p>\n<pre class=\"prettyprint linenums\">&lt;?php\r\n$arr[] = 3000000; \r\n$arr[] = 5000000; \r\n$arr[] = 15000000;\r\n?&gt;<\/pre>\n<p>\u0412 \u0446\u044c\u043e\u043c\u0443 \u0432\u0438\u043f\u0430\u0434\u043a\u0443 \u043f\u0435\u0440\u0448\u0438\u0439 \u0435\u043b\u0435\u043c\u0435\u043d\u0442 (3000000) \u043e\u0442\u0440\u0438\u043c\u0430\u0454 \u0456\u043d\u0434\u0435\u043a\u0441 0! \u0422\u0440\u0435\u0431\u0430 \u043c\u0430\u0442\u0438 \u0446\u0435 \u043d\u0430 \u0443\u0432\u0430\u0437\u0456.<\/p>\n<h3>\u0414\u043b\u044f \u0441\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u044f \u043c\u0430\u0441\u0438\u0432\u0443<\/h3>\n<p>\u0414\u043b\u044f \u0441\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u044f \u043c\u0430\u0441\u0438\u0432\u0443 \u043c\u0438 \u043c\u043e\u0436\u0435\u043c\u043e \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u0430\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0456\u044e <code>array<\/code>:<\/p>\n<pre class=\"prettyprint linenums\">&lt;?php\r\n$arr = array(\"php\", \"html\", \"css\");\r\n?&gt;<\/pre>\n<p>\u0412 \u0446\u044c\u043e\u043c\u0443 \u0432\u0438\u043f\u0430\u0434\u043a\u0443 \u043f\u0435\u0440\u0448\u0438\u0439 \u0435\u043b\u0435\u043c\u0435\u043d\u0442 \u043e\u0442\u0440\u0438\u043c\u0430\u0454 \u0456\u043d\u0434\u0435\u043a\u0441 0. \u042f\u043a\u0449\u043e \u0442\u0440\u0435\u0431\u0430 \u043f\u0440\u0438\u0441\u0432\u043e\u0457\u0442\u0438 \u044f\u043a\u0438\u0439\u0441\u044c \u0456\u043d\u0448\u0438\u0439 \u043d\u043e\u043c\u0435\u0440, \u0442\u043e \u043c\u043e\u0436\u043d\u0430 \u0441\u043a\u043e\u0440\u0438\u0441\u0442\u0430\u0442\u0438\u0441\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0456\u0454\u044e <code>=&gt;<\/code>:<\/p>\n<pre class=\"prettyprint linenums\">&lt;?php\r\n$arr = array(1 =&gt; \"php\", \"html\", \"css\");\r\n?&gt;<\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440 \u0435\u043b\u0435\u043c\u0435\u043d\u0442 \u043f\u0456\u0434 \u043d\u043e\u043c\u0435\u0440\u043e\u043c 1 \u0446\u0435 &#8220;php&#8221;, \u0430 \u043d\u0435 &#8220;html&#8221;! \u0422\u0430\u043a\u043e\u0436, \u043c\u043e\u0436\u043d\u0430 \u0441\u0442\u0432\u043e\u0440\u0438\u0442\u0438 \u043c\u0430\u0441\u0438\u0432 \u0456\u0437 \u0440\u044f\u0434\u043a\u043e\u0432\u0438\u043c \u0456\u043d\u0434\u0435\u043a\u0441\u043e\u043c:<\/p>\n<pre class=\"prettyprint linenums\">&lt;?php\r\n$arr = array(\"first\" =&gt; \"php\", \"second\" =&gt; \"html\", \"third\" =&gt; \"css\");\r\n?&gt;<\/pre>\n<p>\u041f\u043e\u0447\u0438\u043d\u0430\u044e\u0447\u0438 \u0437 \u0432\u0435\u0440\u0441\u0456\u0457 PHP 5.4, \u043c\u0430\u0441\u0438\u0432\u0438 \u043c\u043e\u0436\u043d\u0430 \u0441\u0442\u0432\u043e\u0440\u0438\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u0456 \u0434\u0443\u0436\u043a\u0438:<\/p>\n<pre class=\"prettyprint linenums\">&lt;?php\r\n$arr = [\"php\", \"laravel\", \"yii\", \"zend\", \"cakephp\"];\r\n?&gt;<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u041c\u0430\u0441\u0438\u0432 &#8211; \u0446\u0435 \u043d\u0430\u0431\u0456\u0440 \u0434\u0430\u043d\u0438\u0445, \u044f\u043a\u0456 \u043e\u0431&#8217;\u0454\u0434\u043d\u0430\u043d\u0456 \u043f\u0456\u0434 \u043e\u0434\u043d\u0438\u043c \u0456\u043c&#8217;\u044f\u043c. \u041c\u0430\u0441\u0438\u0432 \u0441\u043a\u043b\u0430\u0434\u0430\u0454\u0442\u044c\u0441\u044f \u0437 \u0434\u0435\u043a\u0456\u043b\u044c\u043a\u043e\u0445 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432, \u044f\u043a\u0456 \u043c\u0430\u044e\u0442\u044c \u0441\u0432\u0456\u0439 \u043f\u0435\u0432\u043d\u0438\u0439 \u0456\u043d\u0434\u0435\u043a\u0441. \u041c\u0430\u0441\u0438\u0432\u0438 \u0441\u0442\u0432\u043e\u0440\u044e\u044e\u0442\u044c\u0441\u044f \u0437\u0430 \u0434\u043e\u043f\u043e\u043c\u043e\u0433\u043e\u044e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u043f\u0440\u0438\u0441\u0432\u043e\u0454\u043d\u043d\u044f, \u0442\u0430\u043a \u0441\u0430\u043c\u043e \u044f\u043a \u0456 \u0437\u043c\u0456\u043d\u043d\u0430. \u0406\u043c\u0435\u043d\u0430 \u043c\u0430\u0441\u0438\u0432\u0456\u0432 \u0440\u043e\u0437\u043f\u043e\u0447\u0438\u043d\u0430\u044e\u0442\u044c\u0441\u044f \u0437\u0456 \u0437\u043d\u0430\u043a\u0443 $, \u043f\u0456\u0441\u043b\u044f \u044f\u043a\u043e\u0433\u043e \u0441\u043b\u0456\u0434\u0443\u0454 \u0434\u043e\u0432\u0456\u043b\u044c\u043d\u0438\u0439 \u0456\u0434\u0435\u043d\u0442\u0438\u0444\u0456\u043a\u0430\u0442\u043e\u0440, \u0434\u0430\u043b\u0456 \u0439\u0434\u0443\u0442\u044c \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u0456 \u0434\u0443\u0436\u043a\u0438: $arr[0] = &#8220;php&#8221;; \u0426\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0456\u044f \u0441\u0442\u0432\u043e\u0440\u044e\u0454 \u043c\u0430\u0441\u0438\u0432 \u0456 \u043f\u0440\u0438\u0441\u0432\u043e\u044e\u0454 [&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-558","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\/558","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=558"}],"version-history":[{"count":2,"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/posts\/558\/revisions"}],"predecessor-version":[{"id":593,"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/posts\/558\/revisions\/593"}],"wp:attachment":[{"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/media?parent=558"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/categories?post=558"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/tags?post=558"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}