for($i = 0 ; $i <= count($_SESSION['cart']) ; $i++) { if($_SESSION['cart'][$i]['Item'] == $id) { $_SESSION['cart'][$i]['Quantity']++; } }