{"id":298,"date":"2011-07-30T22:35:14","date_gmt":"2011-07-30T13:35:14","guid":{"rendered":"http:\/\/takanix.com\/?p=298"},"modified":"2011-08-17T18:15:59","modified_gmt":"2011-08-17T09:15:59","slug":"%e3%80%90php%e3%80%91shift_jis%e5%af%be%e7%ad%96%e3%80%80%e3%80%8c%e3%80%8d%e3%81%8c%e5%85%a5%e3%82%8b%e5%a0%b4%e5%90%88","status":"publish","type":"post","link":"https:\/\/takanix.com\/?p=298","title":{"rendered":"\u3010PHP\u3011Shift_JIS\u5bfe\u7b56\u3000\u300c\\\u300d\u304c\u5165\u308b\u5834\u5408"},"content":{"rendered":"<p>\u643a\u5e2f\u30b5\u30a4\u30c8\u3067Shift_JIS\u306e\u30a8\u30f3\u30b3\u30fc\u30c9\u3067\u4f5c\u3089\u306a\u304d\u3083\u99c4\u76ee\u306a\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u6587\u5b57\u304c\u6587\u5b57\u5316\u3051\u3059\u308b\u3002<\/p>\n<p>\u300c\\\u300d\u304c\u5165\u3063\u3066\u3057\u307e\u3046\u306e\u3060\u3002\u3053\u306e\u5bfe\u7b56\u306e\u30e1\u30e2\u3002<\/p>\n<p><a href=\"https:\/\/takanix.com\/wp-content\/uploads\/2011\/07\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2011-07-30-22.30.25.png\"><img loading=\"lazy\" src=\"https:\/\/takanix.com\/wp-content\/uploads\/2011\/07\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2011-07-30-22.30.25.png\" title=\"\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2011-07-30 22.30.25\" width=\"535\" height=\"81\" class=\"aligncenter size-full wp-image-299\" srcset=\"https:\/\/takanix.com\/wp-content\/uploads\/2011\/07\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2011-07-30-22.30.25.png 535w, https:\/\/takanix.com\/wp-content\/uploads\/2011\/07\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2011-07-30-22.30.25-300x45.png 300w\" sizes=\"(max-width: 535px) 100vw, 535px\" \/><\/a><\/p>\n<p>\u300c\u8868\u300d\u2192\u300c\u8868\\\u300d<br \/>\n\u300c\u7533\u300d\u2192\u300c\u7533\\\u300d<br \/>\n\u300c\u30bd\u300d\u2192\u300c\u30bd\\\u300d<\/p>\n<p>\u3068\u306a\u3063\u3066\u3057\u307e\u3046\u306e\u3067\u3001PHP\u3067\u5909\u6570\u306b\u4ee3\u5165\u3059\u308b\u3068\u304d\u3084\u51fa\u529b\u3059\u308b\u3068\u304d\u306f<br \/>\nstripslashes()\u3092\u4f7f\u3048\u3070\u3044\u3044\u3002<\/p>\n<pre><span style=\"color: #0000ff;\">\u5909\u6570 = stripslashes( \"\u6587\u5b57\u5217\"\u307e\u305f\u306f\u5909\u6570 );<\/span><\/pre>\n<p style=\"padding-left: 30px;\">$test = stripslashes($_POST[&#8216;test&#8217;]);<\/p>\n<p style=\"padding-left: 30px;\">print\u00a0stripslashes($_POST[&#8216;test&#8217;]);<\/p>\n<p style=\"padding-left: 30px;\">\u5909\u6570\u306b\u5165\u308c\u3066\u4f7f\u7528\u3059\u308b\u304b\u3001print\u3092\u4f7f\u7528\u3057\u3066\u3001\u51fa\u529b\u3057\u3066\u3082\u3044\u3044\u3057\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30db\u30fc\u30eb\u306b\u306a\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\u304c\u3001php.ini\u304b.htaccess\u3067<\/p>\n<p>php_value magic_quotes_gpc Off<\/p>\n<p>magic_quotes_gpc\u3092OFF\u306b\u3059\u308c\u3070\u65e9\u3044\u306e\u3060\u304c\u3002\u3002\u3002<\/p>\n<p>\u305d\u306e\u5834\u5408\u306f\u3001\u9006\u306b<\/p>\n<pre><span style=\"color: #0000ff;\">\u5909\u6570 = addslashes( \"\u6587\u5b57\u5217\"\u307e\u305f\u306f\u5909\u6570 );<\/span><\/pre>\n<p style=\"padding-left: 30px;\">$test =<span style=\"font-family: Consolas, Monaco, 'Courier New', Courier, monospace; font-size: 12px; line-height: 18px; white-space: pre;\">addslashes<\/span>($_POST[&#8216;test&#8217;]);<\/p>\n<p style=\"padding-left: 30px;\">print\u00a0<span style=\"font-family: Consolas, Monaco, 'Courier New', Courier, monospace; font-size: 12px; line-height: 18px; white-space: pre;\">addslashes<\/span>($_POST[&#8216;test&#8217;]);<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u643a\u5e2f\u30b5\u30a4\u30c8\u3067Shift_JIS\u306e\u30a8\u30f3\u30b3\u30fc\u30c9\u3067\u4f5c\u3089\u306a\u304d\u3083\u99c4\u76ee\u306a\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u6587\u5b57\u304c\u6587\u5b57\u5316\u3051\u3059\u308b\u3002 \u300c\\\u300d\u304c\u5165\u3063\u3066\u3057\u307e\u3046\u306e\u3060\u3002\u3053\u306e\u5bfe\u7b56\u306e\u30e1\u30e2\u3002 \u300c\u8868\u300d\u2192\u300c\u8868\\\u300d \u300c\u7533\u300d\u2192\u300c\u7533\\\u300d \u300c\u30bd\u300d\u2192\u300c\u30bd\\\u300d \u3068\u306a\u3063\u3066\u3057\u307e\u3046\u306e\u3067\u3001PHP\u3067 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":""},"categories":[78,1],"tags":[604,134,136,135],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/takanix.com\/index.php?rest_route=\/wp\/v2\/posts\/298"}],"collection":[{"href":"https:\/\/takanix.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/takanix.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/takanix.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/takanix.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=298"}],"version-history":[{"count":3,"href":"https:\/\/takanix.com\/index.php?rest_route=\/wp\/v2\/posts\/298\/revisions"}],"predecessor-version":[{"id":409,"href":"https:\/\/takanix.com\/index.php?rest_route=\/wp\/v2\/posts\/298\/revisions\/409"}],"wp:attachment":[{"href":"https:\/\/takanix.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=298"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/takanix.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=298"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/takanix.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=298"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}