<?php
session_start();
if(isset($_GET['p'])){
$_SESSION['producto'][$_SESSION['contador']]['id'] = $_GET['p'];
$_SESSION['contador']++;
}
if(isset($_GET['c'])){
$_SESSION['producto'][$_SESSION['contador']]['can'] = $_GET['c'];
}
print_r($_SESSION['producto']);
result Array ([0] => Array ([can] = > 1 [id] = > 3) [1] = > Array ([id] = > 3) [2] = > Array ([ can] = > 1 [id] = > 3) [3] = > Array ([can] = > 1))
I do not know why only in position 0 are the 2 nested after they separate and how they would go through this array in a loop