{"id":233,"date":"2007-01-15T14:51:02","date_gmt":"2007-01-15T05:51:02","guid":{"rendered":"http:\/\/clouds.tokyo\/blog\/?p=233"},"modified":"2017-02-28T17:36:09","modified_gmt":"2017-02-28T08:36:09","slug":"php_vd_filetype","status":"publish","type":"post","link":"https:\/\/clouds.tokyo\/blog\/php_vd_filetype\/","title":{"rendered":"\u3010PHP\u3011\u30d5\u30a1\u30a4\u30eb\u306e\u62e1\u5f35\u5b50\u306e\u30c1\u30a7\u30c3\u30af"},"content":{"rendered":"<p>\u306a\u306b\u3082\u96e3\u3057\u3044\u3053\u3068\u306f\u3057\u3066\u3044\u307e\u305b\u3093\u304c\u3001<br \/>\n\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u306e\u62e1\u5f35\u5b50\u3092\u30c1\u30a7\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<pre>\r\npublic function check_filetype($value, $args) {\r\n  if($value == '') {\r\n    return null;\r\n  }\r\n  $ext = explode(',', $args);\r\n  for($i = 0; $i < count($ext); $i++) {\r\n    if(strtolower(substr($value, strlen($value) - strlen($ext[$i]) - 1)) == ('.' . $ext[$i])) {\r\n      return null;\r\n    }\r\n  }\r\n  return \"\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3067\u304d\u308b\u30d5\u30a1\u30a4\u30eb\u306e\u62e1\u5f35\u5b50\u306f \" . implode(' , ', $ext) . \" \u3067\u3059\";\r\n}\r\n<\/pre>\n<p>\u3042\u304f\u307e\u3067\u62e1\u5f35\u5b50\u306b\u3088\u308b\u5224\u65ad\u3067\u3059\u3002\u30d5\u30a1\u30a4\u30eb\u306e\u5185\u5bb9\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002<br \/>\n3\u3064\u76ee\u306e\u5f15\u6570\u306b\u30ab\u30f3\u30de\u533a\u5207\u308a\u3067OK\u306a\u62e1\u5f35\u5b50\u3092\u7f85\u5217\u3057\u3066\u6e21\u3057\u307e\u3059\u3002<\/p>\n<pre>\r\ncheck_filetype($filename, 'jpg,jpeg,jpe,png,gif');\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u306a\u306b\u3082\u96e3\u3057\u3044\u3053\u3068\u306f\u3057\u3066\u3044\u307e\u305b\u3093\u304c\u3001 \u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u306e\u62e1\u5f35\u5b50\u3092\u30c1\u30a7\u30c3\u30af\u3057\u307e\u3059\u3002 public function check_filetype($value, $args) { if($value == &#8221;)  &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/clouds.tokyo\/blog\/php_vd_filetype\/\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;\u3010PHP\u3011\u30d5\u30a1\u30a4\u30eb\u306e\u62e1\u5f35\u5b50\u306e\u30c1\u30a7\u30c3\u30af&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"_jetpack_newsletter_access":""},"categories":[2],"tags":[83,96],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pezW3u-3L","jetpack-related-posts":[{"id":663,"url":"https:\/\/clouds.tokyo\/blog\/modx_file\/","url_meta":{"origin":233,"position":0},"title":"\u3010Modx\u3011\u30d5\u30a1\u30a4\u30eb\u7ba1\u7406\u3067\u300c\u3053\u306e\u7a2e\u985e\u306e\u30d5\u30a1\u30a4\u30eb\u306f\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3067\u304d\u307e\u305b\u3093\u300d\u3068\u8a00\u308f\u308c\u308b","author":"yamamoto","date":"2012\u5e7410\u670820\u65e5","format":false,"excerpt":"Modx\u306e\u30d5\u30a1\u30a4\u30eb\u7ba1\u7406\u3067\u30d5\u30a1\u30a4\u30eb\u3092\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3057\u3088\u3046\u3068\u3057\u305f\u3068\u304d\u3001 \u300c\u30b0\u30ed\u30fc\u30d0\u30eb\u8a2d\u5b9a\u300d\u306e\u300c\u30d5\u30a1\u30a4\u30eb\u7ba1\u7406\u2026","rel":"","context":"\u5099\u5fd8\u9332","block_context":{"text":"\u5099\u5fd8\u9332","link":"https:\/\/clouds.tokyo\/blog\/category\/memo\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":390,"url":"https:\/\/clouds.tokyo\/blog\/linux_replace_files\/","url_meta":{"origin":233,"position":1},"title":"\u3010Linux\u3011\u8907\u6570\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u4e00\u62ec\u7f6e\u63db\u3059\u308b","author":"yamamoto","date":"2009\u5e748\u670813\u65e5","format":false,"excerpt":"\u30d5\u30a1\u30a4\u30eb\u3092\u691c\u7d22\u3059\u308bfind\u30b3\u30de\u30f3\u30c9\u3001\u7d50\u679c\u3092\u5f15\u6570\u3068\u3057\u3066\u6e21\u3059xargs\u30b3\u30de\u30f3\u30c9\u3001\u305d\u3057\u3066\u6587\u5b57\u5217\u7f6e\u63db\u3092\u884c\u3046s\u2026","rel":"","context":"\u5099\u5fd8\u9332","block_context":{"text":"\u5099\u5fd8\u9332","link":"https:\/\/clouds.tokyo\/blog\/category\/memo\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":726,"url":"https:\/\/clouds.tokyo\/blog\/linux_ext_delete\/","url_meta":{"origin":233,"position":2},"title":"\u3010Linux\u3011\u62e1\u5f35\u5b50\u3092\u6307\u5b9a\u3057\u3066\u30d5\u30a1\u30a4\u30eb\u3092\u4e00\u62ec\u524a\u9664","author":"yamamoto","date":"2017\u5e745\u670816\u65e5","format":false,"excerpt":"\u4f8b\uff09mp3\u30d5\u30a1\u30a4\u30eb\u3060\u3051\u3092\u4e00\u62ec\u3067\u524a\u9664 find . -name \"*.mp3\" | xargs rm \u2026","rel":"","context":"\u5099\u5fd8\u9332","block_context":{"text":"\u5099\u5fd8\u9332","link":"https:\/\/clouds.tokyo\/blog\/category\/memo\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":833,"url":"https:\/\/clouds.tokyo\/blog\/win_startup\/","url_meta":{"origin":233,"position":3},"title":"\u3010Windows10\u3011\u624b\u52d5\u3067\u30b9\u30bf\u30fc\u30c8\u30a2\u30c3\u30d7\u306b\u30a2\u30d7\u30ea\u3092\u767b\u9332\u3059\u308b","author":"yamamoto","date":"2017\u5e7410\u670817\u65e5","format":false,"excerpt":"\u30b9\u30bf\u30fc\u30c8\u30a2\u30c3\u30d7\u306b\u767b\u9332\u3055\u308c\u305f\u30a2\u30d7\u30ea\u306f Windows\u8d77\u52d5\u6642\u306b\u81ea\u52d5\u7684\u306b\u8d77\u52d5\u3057\u3066\u304f\u308c\u307e\u3059\u3002 \u30a2\u30d7\u30ea\u306e\u8a2d\u5b9a\u3067\u2026","rel":"","context":"\u5099\u5fd8\u9332","block_context":{"text":"\u5099\u5fd8\u9332","link":"https:\/\/clouds.tokyo\/blog\/category\/memo\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":198,"url":"https:\/\/clouds.tokyo\/blog\/php_upload\/","url_meta":{"origin":233,"position":4},"title":"\u3010PHP\u3011\u7c21\u5358\u30d5\u30a1\u30a4\u30eb\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9","author":"yamamoto","date":"2006\u5e749\u670819\u65e5","format":false,"excerpt":"PHP\u5074\u3067\u53d7\u53d6\u3063\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3059\u308b\u95a2\u6570\u3067\u3059\u3002\u7c21\u5358\u3067\u3059\u306d\u3002 function upload_file\u2026","rel":"","context":"\u5099\u5fd8\u9332","block_context":{"text":"\u5099\u5fd8\u9332","link":"https:\/\/clouds.tokyo\/blog\/category\/memo\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":231,"url":"https:\/\/clouds.tokyo\/blog\/php_vd_email\/","url_meta":{"origin":233,"position":5},"title":"\u3010PHP\u3011\u6b63\u898f\u8868\u73fe\u3067\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306e\u30c1\u30a7\u30c3\u30af","author":"yamamoto","date":"2010\u5e744\u670827\u65e5","format":false,"excerpt":"\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306e\u6b63\u898f\u8868\u73fe\u306b\u3064\u3044\u3066\u306f\u6642\u4ee3\u306b\u5408\u308f\u305b\u3066\u8b70\u8ad6\u3055\u308c\u4fee\u6b63\u3055\u308c\u3066\u3044\u304f\u3068\u601d\u3044\u307e\u3059\u3002 \u4e0b\u8a18\u306e\u60c5\u5831\u304c\u4f7f\u3048\u2026","rel":"","context":"\u5099\u5fd8\u9332","block_context":{"text":"\u5099\u5fd8\u9332","link":"https:\/\/clouds.tokyo\/blog\/category\/memo\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/clouds.tokyo\/blog\/wp-json\/wp\/v2\/posts\/233"}],"collection":[{"href":"https:\/\/clouds.tokyo\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/clouds.tokyo\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/clouds.tokyo\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/clouds.tokyo\/blog\/wp-json\/wp\/v2\/comments?post=233"}],"version-history":[{"count":1,"href":"https:\/\/clouds.tokyo\/blog\/wp-json\/wp\/v2\/posts\/233\/revisions"}],"predecessor-version":[{"id":234,"href":"https:\/\/clouds.tokyo\/blog\/wp-json\/wp\/v2\/posts\/233\/revisions\/234"}],"wp:attachment":[{"href":"https:\/\/clouds.tokyo\/blog\/wp-json\/wp\/v2\/media?parent=233"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/clouds.tokyo\/blog\/wp-json\/wp\/v2\/categories?post=233"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/clouds.tokyo\/blog\/wp-json\/wp\/v2\/tags?post=233"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}