{"id":173,"date":"2021-08-03T14:53:15","date_gmt":"2021-08-03T11:53:15","guid":{"rendered":"https:\/\/dimasudarkin.ru\/?p=173"},"modified":"2021-08-03T14:53:16","modified_gmt":"2021-08-03T11:53:16","slug":"kak-php-massiv-vyvesti-v-stroku","status":"publish","type":"post","link":"https:\/\/dimasudarkin.ru\/kak-php-massiv-vyvesti-v-stroku\/","title":{"rendered":"\u041a\u0430\u043a PHP \u043c\u0430\u0441\u0441\u0438\u0432 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0432 \u0441\u0442\u0440\u043e\u043a\u0443?"},"content":{"rendered":"\n

\u0414\u043b\u044f \u0447\u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c php \u043c\u0430\u0441\u0441\u0438\u0432 \u0432 \u0441\u0442\u0440\u043e\u043a\u0443? \u0415\u0441\u0442\u044c 2 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f, \u043a\u043e\u0433\u0434\u0430 \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f<\/p>\n\n\n\n

  1. \u0415\u0441\u043b\u0438 \u0412\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0437\u043d\u0430\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430<\/li>
  2. \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0432\u0441\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0435\u0440\u0435\u0437 \u0437\u0430\u043f\u044f\u0442\u0443\u044e<\/li><\/ol>\n\n\n\n

    \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0432\u044b\u0432\u043e\u0434\u0430 PHP \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0441\u0442\u0440\u043e\u043a\u043e\u0439
    \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043c\u0430\u0441\u0441\u0438\u0432:<\/p>\n\n\n

    \n<?php\n  $array = [\n  \t'\u0410\u043f\u0435\u043b\u044c\u0441\u0438\u043d', \n  \t'\u041c\u0430\u043d\u0434\u0430\u0440\u0438\u043d', \n  \t'\u042f\u0431\u043b\u043e\u043a\u043e', \n  \t'\u0412\u0438\u043d\u043e\u0433\u0440\u0430\u0434', \n  \t'\u0413\u0440\u0443\u0448\u0430' \n  ];\n?>\n<\/pre><\/div>\n\n\n

    \u0421\u043c\u043e\u0442\u0440\u0438\u043c \u043c\u0430\u0441\u0441\u0438\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 var_dump()<\/h2>\n\n\n
    \n<?php\n  var_dump($array);\n?>\n<\/pre><\/div>\n\n\n

    \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/strong><\/p>\n\n\n

    \narray(5) { [0]=> string(16) "\u0410\u043f\u0435\u043b\u044c\u0441\u0438\u043d" [1]=> string(16) "\u041c\u0430\u043d\u0434\u0430\u0440\u0438\u043d" [2]=> string(12) "\u042f\u0431\u043b\u043e\u043a\u043e" [3]=> string(16) "\u0412\u0438\u043d\u043e\u0433\u0440\u0430\u0434" [4]=> string(10) "\u0413\u0440\u0443\u0448\u0430" }\n<\/pre><\/div>\n\n\n

    \u0421\u043c\u043e\u0442\u0440\u0438\u043c \u043c\u0430\u0441\u0441\u0438\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 print_r()<\/h2>\n\n\n
    \n<?php\n  print_r($array);\n?>\n<\/pre><\/div>\n\n\n

    \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/strong><\/p>\n\n\n

    \nArray ( [0] => \u0410\u043f\u0435\u043b\u044c\u0441\u0438\u043d [1] => \u041c\u0430\u043d\u0434\u0430\u0440\u0438\u043d [2] => \u042f\u0431\u043b\u043e\u043a\u043e [3] => \u0412\u0438\u043d\u043e\u0433\u0440\u0430\u0434 [4] => \u0413\u0440\u0443\u0448\u0430 )\n<\/pre><\/div>\n\n\n

    \u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432 \u0432 JSON \u0438 \u0432\u044b\u0432\u0435\u0434\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0441\u0442\u0440\u043e\u043a\u043e\u0439<\/h2>\n\n\n
    \n<?php\n  echo json_encode($array, JSON_UNESCAPED_UNICODE);\n?>\n<\/pre><\/div>\n\n\n

    JSON_UNESCAPED_UNICODE — \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u043b\u0430\u0441\u044c \u043a\u0438\u0440\u0438\u043b\u043b\u0438\u0446\u0430<\/p>\n\n\n\n

    \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/strong><\/p>\n\n\n

    \n["\u0410\u043f\u0435\u043b\u044c\u0441\u0438\u043d","\u041c\u0430\u043d\u0434\u0430\u0440\u0438\u043d","\u042f\u0431\u043b\u043e\u043a\u043e","\u0412\u0438\u043d\u043e\u0433\u0440\u0430\u0434","\u0413\u0440\u0443\u0448\u0430"]\n<\/pre><\/div>\n\n\n

    \u0422\u0430\u043a\u043e\u0439 \u0432\u044b\u0432\u043e\u0434 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043d\u044f\u0442\u0435\u043d \u0438 \u043c\u043d\u0435 \u043e\u043d \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0435<\/p>\n\n\n\n

    \u0421\u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u0431\u043e\u0440 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0438 \u0432\u044b\u0432\u0435\u0434\u0435\u043c \u0432\u0441\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0430<\/h2>\n\n\n
    \n<?php\n  foreach ($array as $arr) {\n  \techo $arr . '<br \/>';\n  }\n?>\n<\/pre><\/div>\n\n\n

    \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/strong><\/p>\n\n\n\n

    \u0410\u043f\u0435\u043b\u044c\u0441\u0438\u043d
    \u041c\u0430\u043d\u0434\u0430\u0440\u0438\u043d
    \u042f\u0431\u043b\u043e\u043a\u043e
    \u0412\u0438\u043d\u043e\u0433\u0440\u0430\u0434
    \u0413\u0440\u0443\u0448\u0430<\/p>\n\n\n\n

    \u0421\u043e\u0431\u0435\u0440\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432 \u0432 \u0441\u0442\u0440\u043e\u043a\u0443 \u0447\u0435\u0440\u0435\u0437 \u0437\u0430\u043f\u044f\u0442\u0443\u044e<\/h2>\n\n\n
    \n<?php\n  echo implode(', ', $array);\n?>\n<\/pre><\/div>\n\n\n

    \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/strong><\/p>\n\n\n

    \n\u0410\u043f\u0435\u043b\u044c\u0441\u0438\u043d, \u041c\u0430\u043d\u0434\u0430\u0440\u0438\u043d, \u042f\u0431\u043b\u043e\u043a\u043e, \u0412\u0438\u043d\u043e\u0433\u0440\u0430\u0434, \u0413\u0440\u0443\u0448\u0430\n<\/pre><\/div>\n\n\n

    \u041d\u0430\u0434\u0435\u044e\u0441\u044c \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u043b\u0441\u044f \u0442\u0430\u043a\u043e\u0439 \u0440\u0430\u0437\u0431\u043e\u0440 \u043c\u0430\u0441\u0441\u0438\u0432\u0430…<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"

    \u0414\u043b\u044f \u0447\u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c php \u043c\u0430\u0441\u0441\u0438\u0432 \u0432 \u0441\u0442\u0440\u043e\u043a\u0443? \u0415\u0441\u0442\u044c 2 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f, \u043a\u043e\u0433\u0434\u0430 \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0415\u0441\u043b\u0438 \u0412\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0437\u043d\u0430\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0432\u0441\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0435\u0440\u0435\u0437 \u0437\u0430\u043f\u044f\u0442\u0443\u044e \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0432\u044b\u0432\u043e\u0434\u0430 PHP \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0441\u0442\u0440\u043e\u043a\u043e\u0439\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043c\u0430\u0441\u0441\u0438\u0432: \u0421\u043c\u043e\u0442\u0440\u0438\u043c \u043c\u0430\u0441\u0441\u0438\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 var_dump() \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: \u0421\u043c\u043e\u0442\u0440\u0438\u043c \u043c\u0430\u0441\u0441\u0438\u0432 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2,30],"tags":[],"_links":{"self":[{"href":"https:\/\/dimasudarkin.ru\/wp-json\/wp\/v2\/posts\/173"}],"collection":[{"href":"https:\/\/dimasudarkin.ru\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dimasudarkin.ru\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dimasudarkin.ru\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dimasudarkin.ru\/wp-json\/wp\/v2\/comments?post=173"}],"version-history":[{"count":1,"href":"https:\/\/dimasudarkin.ru\/wp-json\/wp\/v2\/posts\/173\/revisions"}],"predecessor-version":[{"id":174,"href":"https:\/\/dimasudarkin.ru\/wp-json\/wp\/v2\/posts\/173\/revisions\/174"}],"wp:attachment":[{"href":"https:\/\/dimasudarkin.ru\/wp-json\/wp\/v2\/media?parent=173"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dimasudarkin.ru\/wp-json\/wp\/v2\/categories?post=173"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dimasudarkin.ru\/wp-json\/wp\/v2\/tags?post=173"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}