首頁 >後端開發 >php教程 >php使用post方式获得文件扩展名,_PHP教程

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

WBOY
WBOY原創
2016-07-13 16:53:57957瀏覽

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