首页 >php教程 >PHP源码 >php拷贝文件到相应目录

php拷贝文件到相应目录

PHP中文网
PHP中文网原创
2016-05-25 17:07:061338浏览

php代码

<?php
$directory = dirname(__FILE__);//  /var/bigbluebutton
$iterator = new DirectoryIterator($directory);
foreach ($iterator as $fileinfo)
{
    $path = $fileinfo -> getFilename(); //目录名称
    if (!$fileinfo -> isDot() && $fileinfo -> isDir() && $fileinfo -> getMTime() > time()-5 * 60)
    {
        $cp = $directory . "/" . $path . "/" . $path;
        if (!is_dir($directory . $path . "/" . $path . "/L1"))
        {
            echo "not exits;";
            echo "cp /opt/pdfs/* " . $cp;
            system("cp -rf /opt/pdfs/* " . $cp); //将生成好了的pdf文件到/opt/pdfs
        } 
    } 
} 
?>
声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn