📜  类 stdclass 的对象无法转换为字符串 php laravel - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:22.377000             🧑  作者: Mango

代码示例1
/*
$data is indeed an array, but it's made up of objects.

Convert its content to array before creating it*/
$data = array();
foreach ($results as $result) {
   $result->filed1 = 'some modification';
   $result->filed2 = 'some modification2';
   $data[] = (array)$result;  
   #or first convert it and then change its properties using 
   #an array syntax, it's up to you
}
Excel::create(....