时间:2021-07-01 10:21:17 帮助过:19人阅读
session_start(); header ( "Content-type: text/html; charset=utf-8" ); if($_SESSION["goodsid"]==""){ $_SESSION["goodsid"]=$_GET["id"]."@"; }else{ $array=explode("@",$_SESSION["goodsid"]); if(in_array($_GET["id"],$array)){ $key=array_search($_GET["id"],$array); $array[$key]=""; $_SESSION["goodsid"]=implode("@",$array); }else{ $_SESSION["goodsid"].=$_GET["id"]."@"; } }