I am trying to convert an array where I store some 'products' ($_SESSION['cart']) into a JSON format, but it has been impossible for me
The structure of the $_SESSION['cart'] variable is
$_SESSION['cart']['id_product']['quantity']
I'm using this code to obtain each product, I think i can obtain an array from here
foreach($_SESSION['cart'] as $id_product => $quantity) {
code
}
Thanks