标签:
$src=$_FILES[‘n-img‘][‘tmp_name‘]; $file=$_FILES[‘n-img‘][‘name‘]; $a=explode(‘.‘,$file); $ext=array_pop($a); $rand=time().mt_rand().‘.‘.$ext; $dst="uploadimg/{$rand}"; if($_FILES[‘n-img‘][‘error‘]===0){ if(move_uploaded_file($src,$dst)){ echo "头像上传成功"; }else{ echo "头像未上传成功"; } }
标签:
原文地址:http://www.cnblogs.com/kangshuai/p/5752546.html