Good day, i have an array as such:
$cart = [
'id' => 1,
'item_name' => 'sample',
'quantity' => 20,
'price' => 50,
];
i tried doing this:
'total' => $cart['quantity'] * $cart['price']
i get an undefined index error.
Is there any way to achieve this.
Note: the 'total' key is in the same array $cart.
totalelement