{"id":161,"date":"2012-10-25T20:45:55","date_gmt":"2012-10-25T11:45:55","guid":{"rendered":"https:\/\/www.hstech.net\/?p=161"},"modified":"2019-10-06T20:46:30","modified_gmt":"2019-10-06T11:46:30","slug":"%e3%83%aa%e3%82%b9%e3%83%88%e3%83%9c%e3%83%83%e3%82%af%e3%82%b9%e3%81%a7%e3%81%af%e3%81%be%e3%81%a3%e3%81%9f%ef%bc%81%ef%bc%81","status":"publish","type":"post","link":"https:\/\/www.hstech.net\/?p=161","title":{"rendered":"\u30ea\u30b9\u30c8\u30dc\u30c3\u30af\u30b9\u3067\u306f\u307e\u3063\u305f\uff01\uff01"},"content":{"rendered":"\n<p>\u539f\u56e0\u304c\u5206\u304b\u308c\u3070\u3001\u305f\u308f\u3044\u306e\u306a\u3044\u3053\u3068\u3060\u3063\u305f\u306e\u3067\u3057\u3087\u3046\u304c\u3001\u306f\u307e\u3063\u3066\u3057\u307e\u3063\u305f\u3002<\/p>\n\n\n\n<p>50\u3050\u3089\u3044\u306e\u30c7\u30fc\u30bf\u304b\u3089\u3001\u8907\u6570\u9078\u629e\u3057\u3066DB\u306b\u683c\u7d0d\u3059\u308b\u3053\u3068\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u4e00\u89a7\u3067\u65e2\u9078\u629e\u3092\u898b\u3084\u3059\u304f\u3059\u308b\u306e\u306b\u3001\u30ea\u30b9\u30c8\u30dc\u30c3\u30af\u30b9\u30924\u3064\u4e26\u3079\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>multiple\u3067\u8907\u6570\u9078\u629e\u3092\u53ef\u80fd\u306b\u3057\u3001name=list\uff11\uff5elist4\u3067\u9078\u629e\u30a2\u30a4\u30c6\u30e0\u3092\u6295\u3052\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>DB\u306b\u306f\u5358\u306b\u30ab\u30f3\u30de\u3067\u3064\u306a\u3052\u3066\u683c\u7d0d\u3057\u3001\u53d6\u308a\u51fa\u3059\u3068\u304d\u306bexplode\u3067\u914d\u5217\u306b\u53d6\u308a\u8fbc\u307f\u3001\u3055\u3066\u3069\u3046\u3057\u305f\u3089<\/p>\n\n\n\n<p>selected\u3067\u65e2\u9078\u629e\u306b\u3059\u308c\u3070\u3044\u3044\u304b\u306a\u3068\u60a9\u3093\u3060\u672b\u306b<\/p>\n\n\n\n<p>for($i=0;$i&lt;12;$i++){<\/p>\n\n\n\n<p>if(in_array($i,$array)){<\/p>\n\n\n\n<p>print\u201d&lt;OPTION value=\u201d\u201d.$i\u201d selected&gt;\u201d.pg_result($r,$i,1).\u201d&lt;\/OPTION&gt;\u201d;<\/p>\n\n\n\n<p>}else{<\/p>\n\n\n\n<p>print\u201d&lt;OPTION value=\u201d\u201d.$i\u201d&gt;\u201d.pg_result($r,$i,1).\u201d&lt;\/OPTION&gt;\u201d; }<\/p>\n\n\n\n<p>\u3068\uff14\u3064\u4e26\u3079\u3066\u307f\u307e\u3057\u305f\u3002\uff081\u3064\u306e\u30ea\u30b9\u30c8\u30dc\u30c3\u30af\u30b9\u306b12\u30a2\u30a4\u30c6\u30e0\u3065\u3064\u4e26\u3079\u305f\u306e\u3067\u300112\u5358\u4f4d\u3067\uff09<\/p>\n\n\n\n<p>\u3046\u307e\u304f\u3044\u3063\u305f\u3088\u3046\u306b\u898b\u3048\u305f\u306e\u3067\u3059\u304c\u3001\u6700\u521d\u306e\u30ea\u30b9\u30c8\u30dc\u30c3\u30af\u30b9\u306e\u6700\u521d\u306e\u30a2\u30a4\u30c6\u30e0\u304c<\/p>\n\n\n\n<p>\u3044\u3064\u3082selected\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>in_array\u3067\u201d\uff10\u201d\u306f\u9069\u5207\u306a\u691c\u7d22\u304c\u51fa\u6765\u306a\u3044\u306e\u3060\u308d\u3046\u3068\u601d\u3044\u3001\u4f55\u304b\u307b\u304b\u306e\u65b9\u6cd5\u304c\u306a\u3044\u304b\u3068<\/p>\n\n\n\n<p>\u8003\u3048\u3066\u307f\u3066\u305f\u3089\u30fb\u30fb\u3075\u3068\u6700\u521d\u306e\uff15\uff10\u3050\u3089\u3044\u306e\u30c7\u30fc\u30bf\u30fc\u306f\u30011\u304b\u3089\u756a\u53f7\u3092\u632f\u3063\u3066\u3044\u305f\u306e\u3092\u601d\u3044\u51fa\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>if(in_array($i,$array)){<\/p>\n\n\n\n<p>print\u201d&lt;OPTION value=\u201d\u201d.$i\u201d selected&gt;\u201d.pg_result($r,$i,1).\u201d&lt;\/OPTION&gt;\u201d;\u3092<\/p>\n\n\n\n<p>if(in_array(pg_result($r,$i,0),$array)){<\/p>\n\n\n\n<p>print\u201d&lt;OPTION value=\u201d\u201d.pg_result($r,$i,0).\u201d\u201d selected&gt;\u201d.pg_result($r,$i,1).\u201d&lt;\/OPTION&gt;\u201d;<\/p>\n\n\n\n<p>\u3068\u3059\u308b\u3060\u3051\u306e\u3053\u3068\u3067\u3057\u305f\u3002\u3042\uff5e\u3042\u3064\u304b\u308c\u305f\uff01<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"157\" src=\"https:\/\/www.hstech.net\/wp-content\/uploads\/2019\/10\/44c92f636f3a0a9b9bd27e334edf1403.gif\" alt=\"\" class=\"wp-image-162\"\/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u539f\u56e0\u304c\u5206\u304b\u308c\u3070\u3001\u305f\u308f\u3044\u306e\u306a\u3044\u3053\u3068\u3060\u3063\u305f\u306e\u3067\u3057\u3087\u3046\u304c\u3001\u306f\u307e\u3063\u3066\u3057\u307e\u3063\u305f\u3002 50\u3050\u3089\u3044\u306e\u30c7\u30fc\u30bf\u304b\u3089\u3001\u8907\u6570\u9078\u629e\u3057\u3066DB\u306b\u683c\u7d0d\u3059\u308b\u3053\u3068\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3057\u305f\u3002 \u4e00\u89a7\u3067\u65e2\u9078\u629e\u3092\u898b\u3084\u3059\u304f\u3059\u308b\u306e\u306b\u3001\u30ea\u30b9\u30c8\u30dc\u30c3\u30af\u30b9\u30924\u3064\u4e26\u3079\u3066\u307f\u307e\u3057\u305f\u3002 m [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[14,11],"tags":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hstech.net\/index.php?rest_route=\/wp\/v2\/posts\/161"}],"collection":[{"href":"https:\/\/www.hstech.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hstech.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hstech.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hstech.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=161"}],"version-history":[{"count":1,"href":"https:\/\/www.hstech.net\/index.php?rest_route=\/wp\/v2\/posts\/161\/revisions"}],"predecessor-version":[{"id":163,"href":"https:\/\/www.hstech.net\/index.php?rest_route=\/wp\/v2\/posts\/161\/revisions\/163"}],"wp:attachment":[{"href":"https:\/\/www.hstech.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=161"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hstech.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=161"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hstech.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=161"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}