{"id":163,"date":"2014-07-11T17:07:10","date_gmt":"2014-07-11T08:07:10","guid":{"rendered":"http:\/\/tataka.info\/?p=163"},"modified":"2014-07-11T17:07:10","modified_gmt":"2014-07-11T08:07:10","slug":"java%e4%bd%bf%e3%81%84%e3%81%8cphp%e3%82%92%e8%a7%a6%e3%82%8b%ef%bc%88%ef%bc%92%ef%bc%9a%e5%88%b6%e5%be%a1%e6%96%87%ef%bc%89","status":"publish","type":"post","link":"https:\/\/tataka.info\/?p=163","title":{"rendered":"Java\u4f7f\u3044\u304cPHP\u3092\u89e6\u308b\uff08\uff12\uff1a\u5236\u5fa1\u6587\uff09"},"content":{"rendered":"<p><a href=\"https:\/\/tataka.info\/programming\/java%e4%bd%bf%e3%81%84%e3%81%8cphp%e3%82%92%e8%a7%a6%e3%82%8b%ef%bc%88%ef%bc%91%ef%bc%9a%e5%ae%a3%e8%a8%80%e3%81%a8%e6%bc%94%e7%ae%97%e5%ad%90%ef%bc%89\/\" title=\"Java\u4f7f\u3044\u304cPHP\u3092\u89e6\u308b\uff08\uff11\uff1a\u5ba3\u8a00\u3068\u6f14\u7b97\u5b50\uff09\">\u524d\u56de<\/a>\u306e\u7d9a\u304d\u3002<\/p>\n<p>\u5f15\u304d\u7d9a\u304d\u3053\u306e\u672c\u3067\u5b66\u3076\u3002<br \/>\n<iframe src=\"http:\/\/rcm-fe.amazon-adsystem.com\/e\/cm?lt1=_blank&#038;bc1=000000&#038;IS2=1&#038;bg1=FFFFFF&#038;fc1=000000&#038;lc1=0000FF&#038;t=than360d-22&#038;o=9&#038;p=8&#038;l=as4&#038;m=amazon&#038;f=ifr&#038;ref=ss_til&#038;asins=4873116333\" style=\"width:120px;height:240px;\" scrolling=\"no\" marginwidth=\"0\" marginheight=\"0\" frameborder=\"0\"><\/iframe><\/p>\n<p><!--more--><\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_89 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">\u76ee\u6b21<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/tataka.info\/?p=163\/#if\" >if<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/tataka.info\/?p=163\/#switch\" >switch<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/tataka.info\/?p=163\/#%E4%B8%89%E9%A0%85%E6%BC%94%E7%AE%97%E5%AD%90\" >\u4e09\u9805\u6f14\u7b97\u5b50<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/tataka.info\/?p=163\/#while_do%E2%80%A6while\" >while, do&#8230;while<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/tataka.info\/?p=163\/#for\" >for<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/tataka.info\/?p=163\/#break_continue\" >break continue<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/tataka.info\/?p=163\/#foreach\" >foreach<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/tataka.info\/?p=163\/#%E9%85%8D%E5%88%97%E3%81%AE%E5%A0%B4%E5%90%88\" >\u914d\u5217\u306e\u5834\u5408<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/tataka.info\/?p=163\/#%E9%80%A3%E6%83%B3%E9%85%8D%E5%88%97%E3%81%AE%E5%A0%B4%E5%90%88\" >\u9023\u60f3\u914d\u5217\u306e\u5834\u5408<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"if\"><\/span>if<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u3044\u308f\u3086\u308b\u6761\u4ef6\u5206\u5c90\u3002Java\u3068\u57fa\u672c\u540c\u3058\u3002<br \/>\n<code><br \/>\nif (conditoin1) {<br \/>\n    \/\/<br \/>\n} else if (condition2) {<br \/>\n    \/\/<br \/>\n}<br \/>\n<\/code><br \/>\n\u3053\u308c\u3068<br \/>\n<code><br \/>\nif (conditoin1) {<br \/>\n    \/\/<br \/>\n} elseif (condition2) {<br \/>\n    \/\/<br \/>\n}<br \/>\n<\/code><br \/>\n\u306f\u9055\u3046\u3002else if\u304belseif\u304b\u306e\u9055\u3044\u3060\u304c\u3001\u524d\u8005\u306felse\u306e{}\u304c\u7701\u7565\u3055\u308c\u3066else\u5185\u3067\u65b0\u305f\u306aif\u6587\u304c\u59cb\u307e\u3063\u3066\u3044\u308b\u3002\u5f8c\u8005\u306f\u5358\u7d14\u306b\u3001if-elseif-else\u306e\u69cb\u6587\u3002\u3053\u3053\u306fJava\u3068\u9055\u3046\u306e\u3067\u3001\u6ce8\u610f\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002<\/p>\n<h2><span class=\"ez-toc-section\" id=\"switch\"><\/span>switch<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u3044\u3063\u3057\u3087\u3002<\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E4%B8%89%E9%A0%85%E6%BC%94%E7%AE%97%E5%AD%90\"><\/span>\u4e09\u9805\u6f14\u7b97\u5b50<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u3044\u3063\u3057\u3087\u3002<\/p>\n<h2><span class=\"ez-toc-section\" id=\"while_do%E2%80%A6while\"><\/span>while, do&#8230;while<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u3044\u3063\u3057\u3087\u3002<\/p>\n<h2><span class=\"ez-toc-section\" id=\"for\"><\/span>for<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u3044\u3063\u3057\u3087\u3002<\/p>\n<h3><span class=\"ez-toc-section\" id=\"break_continue\"><\/span>break continue<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Java\u3067\u306f\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306b\u30e9\u30d9\u30eb\u3067\u5927\u304d\u304fbreak\u3067\u304d\u305f\uff08continue\u3082\u540c\u69d8\uff09\u3002<br \/>\n<code><br \/>\nOUTER: for () {<br \/>\n    for() {<br \/>\n        if (condition) {<br \/>\n            break OUTER;<br \/>\n        }<br \/>\n    }<br \/>\n}<br \/>\n<\/code><br \/>\nPHP\u3067\u306fcontinue\u3084break\u306e\u5f8c\u308d\u306b\uff12\u3068\u304b\u3064\u3051\u308b\u3053\u3068\u3067\u3001\uff12\u3064\u5916\u306e\u7e70\u308a\u8fd4\u3057\u3092break\u3067\u304d\u308b\u3002<\/p>\n<h2><span class=\"ez-toc-section\" id=\"foreach\"><\/span>foreach<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Java\u3067\u306f\u62e1\u5f35for\u6587\u6211\u7528\u610f\u3055\u308c\u3066\u3044\u305f\u3002PHP\u3067\u306fforeach\u6587\u3068\u3057\u3066\u7528\u610f\u3055\u308c\u3066\u3044\u308b\u3002<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E9%85%8D%E5%88%97%E3%81%AE%E5%A0%B4%E5%90%88\"><\/span>\u914d\u5217\u306e\u5834\u5408<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><code><br \/>\n$colors = array('green', 'black', 'blue');<br \/>\nforeach($colors as $color) {<br \/>\n    \/\/ something;<br \/>\n}<br \/>\n<\/code><\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E9%80%A3%E6%83%B3%E9%85%8D%E5%88%97%E3%81%AE%E5%A0%B4%E5%90%88\"><\/span>\u9023\u60f3\u914d\u5217\u306e\u5834\u5408<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><code><br \/>\n$fruites = array('apple' => 'red',<br \/>\n               'peach' => 'pink',<br \/>\n               'banana' => 'yellow',<br \/>\n);<br \/>\nforeach ($fruits as $name => $color) {<br \/>\n    \/\/ something<br \/>\n}<br \/>\n<\/code><br \/>\n\u3042\u3044\u304b\u308f\u3089\u305a=>\u304c\u3081\u3093\u3069\u304f\u3055\u3044\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u56de\u306e\u7d9a\u304d\u3002 \u5f15\u304d\u7d9a\u304d\u3053\u306e\u672c\u3067\u5b66\u3076\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,4],"tags":[],"class_list":["post-163","post","type-post","status-publish","format-standard","hentry","category-php","category-programming"],"_links":{"self":[{"href":"https:\/\/tataka.info\/index.php?rest_route=\/wp\/v2\/posts\/163","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tataka.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tataka.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tataka.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tataka.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=163"}],"version-history":[{"count":3,"href":"https:\/\/tataka.info\/index.php?rest_route=\/wp\/v2\/posts\/163\/revisions"}],"predecessor-version":[{"id":167,"href":"https:\/\/tataka.info\/index.php?rest_route=\/wp\/v2\/posts\/163\/revisions\/167"}],"wp:attachment":[{"href":"https:\/\/tataka.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=163"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tataka.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=163"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tataka.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=163"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}