我想在视图中打印出数组元素,以下是我的代码(控制器):
$next_d_dts= \DB::table('tb_billing_cycle')->select('next_due_bill_date')->where('customer_id',$row->customer_id)->get();
return view('invoice.view')->with('next_d_dts',$next_d_dts);
我可以使用print函数打印它,例如:
print_r($next_d_dts);
输出:
Array ( [0] => stdClass Object ( [next_due_bill_date] => 2019-03-28 ) [1] => stdClass Object ( [next_due_bill_date] => 2020-02-28 ) )