0

Below is my current code from quite a while back. each() is now deprecated. Can anyone help with a work-around? Thanks in advance.

foreach ($_SESSION["array"] as $each_id) { 
              $i++;
              
              while (list($key, $value) = each($each_id)) {
                  if ($key == "item_id" && $value == $id_to_adjust) {
                
                      array_splice($_SESSION["array"], $i-1, 1, array(array("item_id" => $id_to_adjust, "size" => $size)));
                  } 
              } 
    } 

0 Answers0