首页  >  文章  >  后端开发  >  php使用post方式获得文件扩展名,_PHP教程

php使用post方式获得文件扩展名,_PHP教程

WBOY
WBOY原创
2016-07-13 16:53:57932浏览

php使用post方式获得文件扩展名,

<form action="" method="post">
    <input type="file" value="" name="file" size="20">
    <input type="submit" value="check">
</form>
<?<span>php
    </span><span>header</span>("Content-type:text/html;charse=utf8"<span>);
    </span><span>if</span>(<span>isset</span>(<span>$_POST</span>['file'<span>])){
        </span><span>$pic</span> = <span>$_POST</span>['file'<span>];
        </span><span>$pics</span> = <span>explode</span>(".", <span>$pic</span><span>);
        </span><span>echo</span> "上传文件的扩展名为:".<span>$pics</span>[<span>count</span>(<span>$pics</span>)-1<span>];        
    }
</span>?>

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/1052440.htmlTechArticlephp使用post方式获得文件扩展名, form action="" method="post" input type="file" value="" name="file" size="20" input type="submit" value="check"/form? php header ("Conte...
声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn