如何从'中解决此非法偏移字符串?我的laravel刀片错误。我正在使用此集合向其发送数据
$results = [
'name' => $Fname,
'from' => $from,
'to' => $to,
];
并且在刀片中:
@foreach($results as $result)
<tr>
<td>{{ $result['from'] }}</td>
<td>{{ $result['to'] }}</td>
<td>{{ $result['name'] }}</td>
</tr>
@endforeach
答案 0 :(得分:0)
$结果需要[]在&#39; =&#39;之前。
$results[] = [
'name' => $Fname,
'from' => $from,
'to' => $to,
];