慕UI4031390
2016-08-16 20:16
<!DOCTYPE html PUBLIC '-//W3C//DTD HTML 4.01 Strict//EN' 'http://www.w3.org/TR/html4/strict.dtd'>
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>
<title>文件上传</title>
</head>
<body>
<form action="doaction.php" method="post" enctype="multipart/form-data">
请选择您要上传的文件:
<input type="file" name="myfile"/><br>
<input type="submit" value="上传文件"/>
</form>
</body>
</html>
<?PHP if(isset($_POST['submit'])) { $string = strrev($_FILES['upfile']['name']); $array = explode('.',$string); echo $array[0]; } ?>
<?php
$wjm="C:zhuomian/img/a.png";
$string=substr($wjm,strrpos($wjm,"."));
echo $string;
echo '<hr>';
//第二个
function string(){
$a="C:/meitu/img/p.text";
$str=substr($a,strrpos($a,"."));
return $str;
}
echo string();
PHP实现文件上传与下载
43735 学习 · 328 问题
相似问题