交互式爱情
这是你想要的,简单的 foreach:$array = ["id" => 1,"user_id" => 30,"list" => [ [ "id" => 1, "card_id" => 6, "amount" => 400, ], [ "id" => 2, "card_id" => 3, "amount" => 500, ] ]];$totalAmount = 0;foreach ($array["list"] as $array){ $totalAmount += $array["amount"];}var_dump($totalAmount);结果:900