{"id":793,"date":"2011-04-28T03:28:42","date_gmt":"2011-04-27T18:28:42","guid":{"rendered":"http:\/\/blog.t-szk.com\/?p=793"},"modified":"2011-04-28T03:28:42","modified_gmt":"2011-04-27T18:28:42","slug":"php%e5%a4%9a%e6%ac%a1%e5%85%83%e9%85%8d%e5%88%97%e3%82%92foreach%e3%81%a7%e3%83%ab%e3%83%bc%e3%83%97%e3%81%95%e3%81%9b%e3%82%8b","status":"publish","type":"post","link":"https:\/\/codaholic.org\/?p=793","title":{"rendered":"[PHP]\u591a\u6b21\u5143\u914d\u5217\u3092foreach\u3067\u30eb\u30fc\u30d7\u3055\u305b\u308b"},"content":{"rendered":"<p>\u4e8c\u6b21\u5143\u4ee5\u4e0a\u306e\u914d\u5217\u3092foreach\u3067\u7e70\u308a\u8fd4\u3057\u51e6\u7406\u3092\u884c\u3046\u306b\u306f\u30cd\u30b9\u30c8\u3055\u305b\u308b\u5fc5\u8981\u304c\u3042\u308b\u3088\u3046\u3067\u3059\u3002\u5168\u3066\u3067\u306f\u306a\u3044\u3051\u308c\u3069\u3082\u3001\u90e8\u5206\u7684\u306b\u5b50\u306e\u914d\u5217\u3092\u6301\u3064\u3088\u3046\u306a\u914d\u5217\u3092foreach\u3067\u30eb\u30fc\u30d7\u3055\u305b\u308b\u5834\u5408\u306e\u30b5\u30f3\u30d7\u30eb\u3092\u8a18\u8f09\u3057\u307e\u3059\u3002<\/p>\n<p><!--more--><br \/>\n[php]<br \/>\n<?php\n\t$hoge = array(\n\t\t'\u5317\u6d77\u9053' => &#8216;\u672d\u5e4c\u5e02&#8217;,<br \/>\n\t\t&#8216;\u57fc\u7389\u770c&#8217; => array(<br \/>\n\t\t\t&#8216;\u3055\u3044\u305f\u307e\u5e02&#8217;,<br \/>\n\t\t\t&#8216;\u6625\u65e5\u90e8\u5e02&#8217;<br \/>\n\t\t),<br \/>\n\t\t&#8216;\u6771\u4eac\u90fd&#8217; => array(<br \/>\n\t\t\t&#8216;\u54c1\u5ddd\u533a&#8217;,<br \/>\n\t\t\t&#8216;\u6c5f\u6771\u533a&#8217;,<br \/>\n\t\t\t&#8216;\u6c5f\u6238\u5ddd\u533a&#8217;<br \/>\n\t\t)<br \/>\n\t);<\/p>\n<p>\tforeach($hoge as $x){<br \/>\n\t\tif(is_array($x)){<br \/>\n\t\t\tforeach($x as $y){<br \/>\n\t\t\t\tprint $y . &#8216;<br \/>&#8216;;<br \/>\n\t\t\t}<br \/>\n\t\t}<br \/>\n\t}<br \/>\n?><br \/>\n[\/php]<\/p>\n<p><strong>16\u884c\u76ee<\/strong><br \/>\nforeach\u306b\u914d\u5217\u3067\u306a\u3044\u3082\u306e\u3092\u6e21\u3059\u3068Warning\u304c\u8868\u793a\u3055\u308c\u308b\u305f\u3081\u3001\u914d\u5217\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3057\u3066\u914d\u5217\u306e\u5834\u5408\u306e\u307fforeach\u3092\u5b9f\u884c\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002<br  \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e8c\u6b21\u5143\u4ee5\u4e0a\u306e\u914d\u5217\u3092foreach\u3067\u7e70\u308a\u8fd4\u3057\u51e6\u7406\u3092\u884c\u3046\u306b\u306f\u30cd\u30b9\u30c8\u3055\u305b\u308b\u5fc5\u8981\u304c\u3042\u308b\u3088\u3046\u3067\u3059\u3002\u5168\u3066\u3067\u306f\u306a\u3044\u3051\u308c\u3069\u3082\u3001\u90e8\u5206\u7684\u306b\u5b50\u306e\u914d\u5217\u3092\u6301\u3064\u3088\u3046\u306a\u914d\u5217\u3092foreach\u3067\u30eb\u30fc\u30d7\u3055\u305b\u308b\u5834\u5408\u306e\u30b5\u30f3\u30d7\u30eb\u3092\u8a18\u8f09\u3057\u307e\u3059\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[4],"tags":[42,244],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8gd1W-cN","_links":{"self":[{"href":"https:\/\/codaholic.org\/index.php?rest_route=\/wp\/v2\/posts\/793"}],"collection":[{"href":"https:\/\/codaholic.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codaholic.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codaholic.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codaholic.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=793"}],"version-history":[{"count":2,"href":"https:\/\/codaholic.org\/index.php?rest_route=\/wp\/v2\/posts\/793\/revisions"}],"predecessor-version":[{"id":795,"href":"https:\/\/codaholic.org\/index.php?rest_route=\/wp\/v2\/posts\/793\/revisions\/795"}],"wp:attachment":[{"href":"https:\/\/codaholic.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=793"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codaholic.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=793"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codaholic.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=793"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}