Laravel-Excel: still can not get data!!

I use it to get excel data like this:

$excel = App::make ( ‘excel’ ); $excel->load ( ‘d:\2014051.xls’, function ($reader) {

    // Loop through all sheets
    $reader->each(function($sheet) {

        // Loop through all rows
        $sheet->each(function($row) {
            print_r($row);
            echo '=================================';
        });

    });
} );

The output is Maatwebsite\Excel\Collections\CellCollection Object ( [title:protected] => [items:protected] => Array ( ) ) in fact my file has data

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 22 (9 by maintainers)

Most upvoted comments

Thanks for sending the file.

The problems seems to be the Chinese inside the headings. To fix this problem you should disable the to_ascii setting inside the excel::import.to_ascii config import setting.

'to_ascii'  =>  false,

Alternatively you can change excel::import.heading to something else, like original.