<html>
<head>
<title></title>
</head>
<body>
<form action="" method="post">
<input type="file" name="file">
<input type="submit" value="upload">
</form>
</body>
</html>
<?php
if($_POST){
$a=strrev($_POST['file']);//反转
$b=explode(".",$a);//才分
$c=strrev($b[0]);
echo "文件后缀为:$c ";
}
<head>
<title></title>
</head>
<body>
<form action="" method="post">
<input type="file" name="file">
<input type="submit" value="upload">
</form>
</body>
</html>
<?php
if($_POST){
$a=strrev($_POST['file']);//反转
$b=explode(".",$a);//才分
$c=strrev($b[0]);
echo "文件后缀为:$c ";
}
?>