• 技术文章 >php教程 >php手册

    php目录拷贝实现方法,php目录拷贝

    2016-06-13 08:58:10原创419

    php目录拷贝实现方法,php目录拷贝


    本文实例讲述了php目录拷贝实现方法。分享给大家供大家参考。具体如下:

    function copy_dir($src,$dst) {
      $dir = opendir($src);
      @mkdir($dst);
      while(false !== ( $file = readdir($dir)) ) {
        if (( $file != '.' ) && ( $file != '..' )) {
          if ( is_dir($src . '//m.sbmmt.com/m/' . $file) ) {
            copy_dir($src . '//m.sbmmt.com/m/' . $file,$dst . '//m.sbmmt.com/m/' . $file);
            continue;
          }
          else {
            copy($src . '//m.sbmmt.com/m/' . $file,$dst . '//m.sbmmt.com/m/' . $file);
          }
        }
      }
      closedir($dir);
    }
    copy_dir('e:/www/chat','e:/www/chat3');
    
    

    希望本文所述对大家的php程序设计有所帮助。

    声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。
    专题推荐:php 目录 拷贝 文件夹
    上一篇:PHP output_buffering 你了解多少,phpoutputbuffering 下一篇:腾讯php经历,腾讯php
    20期PHP线上班

    相关文章推荐

    • 【活动】充值PHP中文网VIP即送云服务器• PHP上传文件时自动分配路径的方法• php批量添加数据与批量更新数据的实现方法,php添加数据• MVC with PHP(二)• PHP防注入之程序里的敏感信息• php配合jquery实现增删操作
    1/1

    PHP中文网