📜  数组会话 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:20.356000             🧑  作者: Mango

代码示例1


//my ex

$id = $_GET['PId'];
                                // $cartArray = array(
                                  
                                // );
                               // array_push($cartArray, $id);
                                session_start();

                            // $_SESSION["cart"] = $cartArray;
                             $_SESSION['cart'][] = $id;

                             header("Content-type:application/json");
                             echo json_encode($_SESSION["cart"]);