Php Can';t打印Excel文件值
我需要读取Excel文件并将其记录在我的数据库中。我正在使用Laravel+读取文件。使用当前代码,我没有收到任何错误,但浏览器中没有显示任何数据:Php Can';t打印Excel文件值,php,excel,laravel,Php,Excel,Laravel,我需要读取Excel文件并将其记录在我的数据库中。我正在使用Laravel+读取文件。使用当前代码,我没有收到任何错误,但浏览器中没有显示任何数据: <?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Http\Requests; use App\Http\Controllers\Controller; Use Excel; class ImportController extends
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
Use Excel;
class ImportController extends Controller
{
public function index()
{
Excel::load('test.xls', function($reader) {
$result = $reader->get();
foreach ($result as $key => $value) {
echo $value->situation;
}
})->get();
}
}
您可以通过以下方式循环结果:
// Loop through all sheets
$reader->each(function($sheet) {
// Loop through all rows
$sheet->each(function($row) {
});
});
您可以在上找到更多信息。您是否在结果上进行了var\u转储
?