且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从Laravel中的数组对象数组获取数据

更新时间:2023-11-30 22:41:28

如果要将数组对象数据转换为数组.这很简单.您首先会获得所有记录.类似的事情:

If you want to convert array object data in to array. This is very simple. You first get all the records.Something like that:

$orders = DB::table('orders')->get(); //get all records form table
$orders = json_decode(json_encode($orders),true);// this will convert data into array
echo "<pre>"; print_r($orders); die; // now echo

然后您可以在刀片文件中使用foreach

and after that you can use foreach in blade file