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

刘华世的官方博客-https://www.pythonschool.com

浙公网安备 33010602011771号