加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

php – copy和move_uploaded_file之间的区别

发布时间:2020-12-13 18:09:48 所属栏目:PHP教程 来源:网络整理
导读:what is difference between copy() and move_uploaded_file() 我认为两个函数执行相同的操作然后有什么区别? copy ( $_FILES['file']['tmp_name'],"C:/Apache/htdocs/" . $_FILES['file']['name'] ) move_uploaded_file($_FILES['file']['tmp_name'],"C:/A

what is difference between copy() and move_uploaded_file()

我认为两个函数执行相同的操作然后有什么区别?

copy ( $_FILES['file']['tmp_name'],"C:/Apache/htdocs/" . $_FILES['file']['name'] ) 


move_uploaded_file($_FILES['file']['tmp_name'],"C:/Apache/htdocs/" . $_FILES['file']['name'])

This function checks to ensure that the file designated by filename is
a valid upload file (meaning that it was uploaded via PHP’s HTTP POST
upload mechanism). If the file is valid,it will be moved to the
filename given by destination.

This sort of check is especially important if there is any chance that
anything done with uploaded files could reveal their contents to the
user,or even to other users on the same system.

http://php.net/manual/en/function.move-uploaded-file.php

If filename is not a valid upload file,then no action will occur,and move_uploaded_file() will return FALSE.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读