{"id":28,"date":"2006-06-13T20:50:23","date_gmt":"2006-06-13T11:50:23","guid":{"rendered":"https:\/\/deskplate.net\/blog\/2006\/06\/13\/php-checkbox-form\/"},"modified":"2006-06-13T20:50:23","modified_gmt":"2006-06-13T11:50:23","slug":"php-checkbox-form","status":"publish","type":"post","link":"https:\/\/deskplate.net\/blog\/archives\/28","title":{"rendered":"PHP checkbox  FORM"},"content":{"rendered":"<p>checkbox \u306e value \u304c\u5206\u304b\u3063\u3066\u3044\u306a\u3044\u5834\u5408\u306e\u53d7\u3051\u6e21\u3057<br \/>\n\u3053\u3093\u306a\u98a8\u306b\u3059\u308c\u3070\u7c21\u5358\u3067\u3059\u306d<br \/>\n&lt;form action=&#8221;check.php&#8221;&gt;<br \/>\n&lt;input type=&#8221;checkbox&#8221; name=&#8221;fC[]&#8221; value=&#8221;hoge&#8221;&gt; hoge &lt;br&gt;<br \/>\n&lt;input type=&#8221;checkbox&#8221; name=&#8221;fC[]&#8221; value=&#8221;foo&#8221;&gt;  foo &lt;br&gt;<br \/>\n&lt;input type=&#8221;checkbox&#8221; name=&#8221;fC[]&#8221; value=&#8221;bar&#8221;&gt;  bar &lt;br&gt;<br \/>\n&lt;input type=&#8221;submit&#8221; value=&#8221;OK&#8221;&gt;<br \/>\n&lt;\/form&gt;<br \/>\ncheck.php<br \/>\n&lt;?php<br \/>\n\/\/ \u914d\u5217 $fC \u306b\u5024\u304c\u5165\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\n\/\/ \u6dfb\u3048\u5b57\u306f 0 \u304b\u3089\u9023\u7d9a\u3067\u3002<br \/>\n\/\/ \u4f8b\u3048\u3070\u3001hoge \u3068 bar \u3092\u30c1\u30a7\u30c3\u30af\u3057\u305f\u5834\u5408\u306f<br \/>\n\/\/ $fC[0] =&gt; &#8220;hoge&#8221; \u3001 $fC[1] =&gt; &#8220;bar&#8221; \u3068\u306a\u308a\u307e\u3059\u3002<br \/>\nfor( $i=0; $i&lt;count($_POST[&#8216;fC&#8217;]); $i++ ) {<br \/>\n\u3000\u3000\u3000print $i .&#8221; ::: &#8221; . $_POST[&#8216;fC&#8217;][$i]. &#8220;&lt;br&gt;\\n&#8221;;<br \/>\n}<br \/>\n?&gt;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>checkbox \u306e value \u304c\u5206\u304b<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-28","post","type-post","status-publish","format-standard","hentry","category-php"],"_links":{"self":[{"href":"https:\/\/deskplate.net\/blog\/wp-json\/wp\/v2\/posts\/28","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/deskplate.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/deskplate.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/deskplate.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/deskplate.net\/blog\/wp-json\/wp\/v2\/comments?post=28"}],"version-history":[{"count":0,"href":"https:\/\/deskplate.net\/blog\/wp-json\/wp\/v2\/posts\/28\/revisions"}],"wp:attachment":[{"href":"https:\/\/deskplate.net\/blog\/wp-json\/wp\/v2\/media?parent=28"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/deskplate.net\/blog\/wp-json\/wp\/v2\/categories?post=28"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/deskplate.net\/blog\/wp-json\/wp\/v2\/tags?post=28"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}