php – copy和move_uploaded_file之间的区别

前端之家收集整理的这篇文章主要介绍了php – copy和move_uploaded_file之间的区别前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

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.

原文链接:https://www.f2er.com/php/134787.html

猜你在找的PHP相关文章