我想将数据从我的 json 导出到 csv 文件,但我收到此错误无法使用 stdClass 类型的对象作为数组
我想知道如何将它用作数组
public function exportUsers()
{
$users = ServicePoint::all()->where("nature", "SP")->toArray();
$users = ServicePoint::all()->where('statut','<>', 2);
$arrayCsv = [];
foreach ($users as $key => $line){
$arrayCsv[$key][] = $line['name'];
$arrayCsv[$key][] = $line['lastname'];
$arrayCsv[$key][] = $line['email'];
}
有什么可以帮忙的
胡说叔叔
BIG阳
紫衣仙女