在下面的php代码执行ajax调用,但我想检查$ cart_final变量值,但它没有打印虽然我已经使用了die函数。请建议我任何解决方案。
if(!empty($_SESSION['shopping_cart']['item']) && $_SESSION['shopping_cart']['item']['meal_dish_type']==$meal_dish_type)
{
$item[]=array('meal_type'=>$meal_type,'meal_package'=>$meal_package,'meal_time'=>$meal_time,'meal_plan_days'=>$meal_plan_days,'meal_dish_type'=>$meal_dish_type,'prefixed_qty'=>$prefixed_qty,'prefixed_date'=>$prefixed_date,'cart_plan'=>$cart_total,'product_rule'=>$product_rule,'prefixed_date_item'=>$prefixed_date_item);
//$dish=array_push($dish,$item);
$cart_final = array_merge($_SESSION['shopping_cart']['item'], $item);
print_r($cart_final); die;// i want to print this value
$_SESSION['shopping_cart']['item'] = $cart_final;
//$_SESSION['shopping_cart']['item'] = $dish;
$_SESSION['shopping_cart']['cart_total'] = $cart_total*$prefixed_qty;
}