search
Homephp教程php手册PHP 文件或文件夹拷本

function copyFPHP($f){
 $files=explode("|||",$f);
 if(is_dir($files[0])){
  if(copydir($files[0],$files[1])){
   echo "$files[0] copy success";
  }else{
   echo "$files[0] rename failed";
  }
 }elseif(is_file($files[0])){
  if(copy($files[0],$files[1])) {
   echo "$files[0] copy success";
  }else{
   echo "$files[0] rename failed";
  }
 }else{
  echo "没找到文件";
 }
}

function copydir($dirf,$dirt){//目录拷贝函数
    $mydir=@opendir($dirf);
 if(!@mkdir($dirt))return false;
    while($file=@readdir($mydir)){
        if((is_dir("$dirf/$file"))&&($file!=".")&&($file!="..")){
   if(!@copydir("$dirf/$file","$dirt/$file"))return false;
        }elseif(is_file("$dirf/$file")){
   if(!@copy("$dirf/$file","$dirt/$file"))return false;
  }
 }
    return true;
}

昨天写的~~ -_-.......... //传参数为 c:\test\|||c:\ttt\ 

函数自动讲 c:\test\ 拷贝为 c:\ttt\ 

 



Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools