0

如何使用 laravel 将文件夹内的所有文件复制到另一个文件夹

我试过这个:

  <?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use XBase\Table;
use File;

class WorkController extends Controller
{
    //
    public function index()
    {         
      $dir = public_path('dbf');

      // $new_path = public_path('new_files');

        $files1 = scandir($dir);

        $count=count($files1);
        for($i=1;$i<$count;$i++)
        {
            if($files1[$i]!='.' && $files1[$i]!='..')
            {
                $file=$files1[$i];
                //$myfile = fopen($file, "r");



                $table = new Table(public_path('dbf\\') . $file);
                $table->move('coped_Data',$file); 

                while ($record = $table->nextRecord()) 
                {
                    echo "For".$i."<br>".$record->folio_no;
                }

            }


        }

    }

}

以上就是全部代码

它向我展示了这个错误

" 调用未定义的方法 XBase\Table::move() "

4

0 回答 0