如何从Laravel 5.2中的excel文件中删除空标题

时间:2017-03-29 15:50:56

标签: php laravel-5.2

我用这个函数从excel文件中读取数据。但是在某些情况下,如果excel表格中有空行,那么我们就不应该阅读,并且它还有空标题会停止进程,请帮帮我谢谢..

enter image description here

  $path = Input::file('import_file');

  $data_read = Excel::load($path, function($reader) {
    $reader->limit(25);
  })->get();


  $hrs =  Excel::selectSheetsByIndex(0)->load($path, function($reader){
   $results = $reader->noHeading();         
  })->get();

0 个答案:

没有答案