欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

php 复制文件到指定目录

复制一个文件到指定的目录,可自行设置文件目的目录及复制的文件的文件名


<?php

//复制图片

function file2dir($sourcefile, $dir,$filename){

     if( ! file_exists($sourcefile)){

         return false;

     }

     //$filename = basename($sourcefile);

     return copy($sourcefile, $dir .''. $filename);

}

file2dir("01/5.jpg", "01/successImg/","a.jpg");

?>






来自:https://blog.csdn.net/muzi187/article/details/61416370




普通分类: