{"id":569,"date":"2020-05-22T11:46:48","date_gmt":"2020-05-22T08:46:48","guid":{"rendered":"https:\/\/ek.oa.edu.ua\/Kukhta\/test3\/?p=569"},"modified":"2020-05-22T16:43:56","modified_gmt":"2020-05-22T13:43:56","slug":"sortuvannia-masyviv-v-php","status":"publish","type":"post","link":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/sortuvannia-masyviv-v-php\/","title":{"rendered":"\u0421\u043e\u0440\u0442\u0443\u0432\u0430\u043d\u043d\u044f \u043c\u0430\u0441\u0438\u0432\u0456\u0432"},"content":{"rendered":"<p>\u0414\u0443\u0436\u0435 \u0447\u0430\u0441\u0442\u043e \u043f\u043e\u0442\u0440\u0456\u0431\u043d\u043e \u0432\u0456\u0434\u0441\u043e\u0440\u0442\u0443\u0432\u0430\u0442\u0438 \u043c\u0430\u0441\u0438\u0432 \u0437\u0430 \u0456\u043d\u0434\u0435\u043a\u0441\u043e\u043c \u0439\u043e\u0433\u043e \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432, \u0437\u0430 \u0430\u043b\u0444\u0430\u0432\u0456\u0442\u043e\u043c \u0439\u043e\u0433\u043e \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432, \u0437\u0430 \u0437\u0440\u043e\u0441\u0442\u0430\u043d\u043d\u044f\u043c, \u0437\u0430 \u0441\u043f\u0430\u0434\u0430\u043d\u043d\u044f\u043c \u0456 \u0442.\u0434. \u0423 PHP \u0434\u043b\u044f \u0446\u044c\u043e\u0433\u043e \u0456\u0441\u043d\u0443\u0454 \u0432\u0435\u043b\u0438\u043a\u0430 \u043a\u0456\u043b\u044c\u043a\u0456\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0456\u0439, \u0456 \u0432 \u0446\u044c\u043e\u043c\u0443 \u0443\u0440\u043e\u0446\u0456 \u043c\u0438 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c\u043e \u0441\u0430\u043c\u0435 \u043f\u0440\u043e \u043d\u0438\u0445.<\/p>\n<p>\u041f\u0435\u0440\u0448\u0430 \u0444\u0443\u043d\u043a\u0446\u0456\u044f &#8211; <code>sort<\/code>, \u044f\u043a\u0430 \u0441\u043e\u0440\u0442\u0443\u0454 \u043c\u0430\u0441\u0438\u0432 \u0437\u0430 \u0437\u0440\u043e\u0441\u0442\u0430\u043d\u043d\u044f\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u044c \u0439\u043e\u0433\u043e \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432, \u043f\u0440\u0438 \u0446\u044c\u043e\u043c\u0443 \u0437\u043c\u0456\u043d\u044e\u044e\u0447\u0438 \u0456\u043d\u0434\u0435\u043a\u0441 \u043f\u0456\u0441\u043b\u044f \u0441\u043e\u0440\u0442\u0443\u0432\u0430\u043d\u043d\u044f:<\/p>\n<pre class=\"prettyprint linenums\">&lt;?php\r\n$arr[0] = \"PHP\"; \r\n$arr[1] = \"HTML\"; \r\n$arr[2] = \"CSS\";\r\n\r\nsort($arr);\r\n\r\nprint_r($arr);\r\n?&gt;<\/pre>\n<p>\u0423 \u043d\u0430\u0448\u043e\u043c\u0443 \u0432\u0438\u043f\u0430\u0434\u043a\u0443, \u043c\u0430\u0441\u0438\u0432 \u0432\u0456\u0434\u0441\u043e\u0440\u0442\u0443\u0454\u0442\u044c\u0441\u044f \u0432 \u0430\u043b\u0444\u0430\u0432\u0456\u0442\u043d\u043e\u043c\u0443 \u043f\u043e\u0440\u044f\u0434\u043a\u0443. \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; CSS [1] =&gt; HTML [2] =&gt; PHP )<\/pre>\n<p>\u0414\u0440\u0443\u0433\u0430 \u0444\u0443\u043d\u043a\u0446\u0456\u044f &#8211; <code>rsort<\/code>, \u044f\u043a\u0430 \u0441\u043e\u0440\u0442\u0443\u0454 \u043c\u0430\u0441\u0438\u0432 \u0437\u0430 \u0441\u043f\u0430\u0434\u0430\u043d\u043d\u044f\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u044c \u0439\u043e\u0433\u043e \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432, \u043f\u0440\u0438 \u0446\u044c\u043e\u043c\u0443 \u043d\u0435 \u0437\u043c\u0456\u043d\u044e\u044e\u0447\u0438 \u0456\u043d\u0434\u0435\u043a\u0441 \u043f\u0456\u0441\u043b\u044f \u0441\u043e\u0440\u0442\u0443\u0432\u0430\u043d\u043d\u044f:<\/p>\n<pre class=\"prettyprint linenums\">&lt;?php\r\n$arr[0] = \"PHP\"; \r\n$arr[1] = \"HTML\"; \r\n$arr[2] = \"CSS\";\r\n\r\nrsort($arr);\r\n\r\nprint_r($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 )<\/pre>\n<p>\u0422\u0440\u0435\u0442\u044f \u0444\u0443\u043d\u043a\u0446\u0456\u044f &#8211; <code>ksort<\/code>, \u044f\u043a\u0430 \u0441\u043e\u0440\u0442\u0443\u0454 \u043c\u0430\u0441\u0438\u0432 \u0437\u0430 \u043a\u043b\u044e\u0447\u0430\u043c\u0438, \u0437\u0431\u0435\u0440\u0456\u0433\u0430\u044e\u0447\u0438 \u0432\u0456\u0434\u043d\u043e\u0441\u0438\u043d\u0438 \u043c\u0456\u0436 \u043a\u043b\u044e\u0447\u0430\u043c\u0438 \u0456 \u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f\u043c\u0438:<\/p>\n<pre class=\"prettyprint linenums\">&lt;?php\r\n$arr[0] = \"PHP\"; \r\n$arr[1] = \"HTML\"; \r\n$arr[2] = \"CSS\";\r\n\r\nksort($arr);\r\n\r\nprint_r($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 )<\/pre>\n<p>\u041d\u0430\u0441\u0442\u0443\u043f\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0456\u044f &#8211; <code>krsort<\/code>, \u044f\u043a\u0430 \u0441\u043e\u0440\u0442\u0443\u0454 \u043c\u0430\u0441\u0438\u0432 \u0437\u0430 \u0441\u043f\u0430\u0434\u0430\u043d\u043d\u044f\u043c \u0456\u043d\u0434\u0435\u043a\u0441\u0456\u0432 \u0439\u043e\u0433\u043e \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432:<\/p>\n<pre class=\"prettyprint linenums\">&lt;?php\r\n$arr[0] = \"PHP\"; \r\n$arr[1] = \"HTML\"; \r\n$arr[2] = \"CSS\";\r\n\r\nkrsort($arr);\r\n\r\nprint_r($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 ( [2] =&gt; CSS [1] =&gt; HTML [0] =&gt; PHP )<\/pre>\n<p>\u0426\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u0456, \u0430\u043b\u0435 \u043d\u0435 \u0432\u0441\u0456 \u0444\u0443\u043d\u043a\u0446\u0456\u0457 \u0434\u043b\u044f \u0441\u043e\u0440\u0442\u0443\u0432\u0430\u043d\u043d\u044f \u043c\u0430\u0441\u0438\u0432\u0456\u0432, \u0431\u0456\u043b\u044c\u0448\u0435 \u0444\u0443\u043d\u043a\u0446\u0456\u0439 \u0434\u0438\u0432\u0456\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u0442\u043e\u0440\u0456\u043d\u0446\u0456 &#8211; <a href=\"https:\/\/ek.oa.edu.ua\/Kukhta\/test3\/funktsii-dlia-roboty-z-masyvamy-v-php\/\">\u0424\u0443\u043d\u043a\u0446\u0456\u0457 \u0434\u043b\u044f \u0440\u043e\u0431\u043e\u0442\u0438 \u0437 \u043c\u0430\u0441\u0438\u0432\u0430\u043c\u0438 \u0432 PHP<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0414\u0443\u0436\u0435 \u0447\u0430\u0441\u0442\u043e \u043f\u043e\u0442\u0440\u0456\u0431\u043d\u043e \u0432\u0456\u0434\u0441\u043e\u0440\u0442\u0443\u0432\u0430\u0442\u0438 \u043c\u0430\u0441\u0438\u0432 \u0437\u0430 \u0456\u043d\u0434\u0435\u043a\u0441\u043e\u043c \u0439\u043e\u0433\u043e \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432, \u0437\u0430 \u0430\u043b\u0444\u0430\u0432\u0456\u0442\u043e\u043c \u0439\u043e\u0433\u043e \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432, \u0437\u0430 \u0437\u0440\u043e\u0441\u0442\u0430\u043d\u043d\u044f\u043c, \u0437\u0430 \u0441\u043f\u0430\u0434\u0430\u043d\u043d\u044f\u043c \u0456 \u0442.\u0434. \u0423 PHP \u0434\u043b\u044f \u0446\u044c\u043e\u0433\u043e \u0456\u0441\u043d\u0443\u0454 \u0432\u0435\u043b\u0438\u043a\u0430 \u043a\u0456\u043b\u044c\u043a\u0456\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0456\u0439, \u0456 \u0432 \u0446\u044c\u043e\u043c\u0443 \u0443\u0440\u043e\u0446\u0456 \u043c\u0438 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c\u043e \u0441\u0430\u043c\u0435 \u043f\u0440\u043e \u043d\u0438\u0445. \u041f\u0435\u0440\u0448\u0430 \u0444\u0443\u043d\u043a\u0446\u0456\u044f &#8211; sort, \u044f\u043a\u0430 \u0441\u043e\u0440\u0442\u0443\u0454 \u043c\u0430\u0441\u0438\u0432 \u0437\u0430 \u0437\u0440\u043e\u0441\u0442\u0430\u043d\u043d\u044f\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u044c \u0439\u043e\u0433\u043e \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432, \u043f\u0440\u0438 \u0446\u044c\u043e\u043c\u0443 \u0437\u043c\u0456\u043d\u044e\u044e\u0447\u0438 \u0456\u043d\u0434\u0435\u043a\u0441 \u043f\u0456\u0441\u043b\u044f \u0441\u043e\u0440\u0442\u0443\u0432\u0430\u043d\u043d\u044f: &lt;?php [&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-569","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\/569","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=569"}],"version-history":[{"count":3,"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/posts\/569\/revisions"}],"predecessor-version":[{"id":588,"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/posts\/569\/revisions\/588"}],"wp:attachment":[{"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/media?parent=569"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/categories?post=569"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/tags?post=569"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}