时间:2021-07-01 10:21:17 帮助过:4人阅读
'xx', 'age'=>20, 'sex'=>'is_nan', ); session_destroy(); //销毁session if(isset($_SESSION)){ print_r($_SESSION); }else{ echo "session以销毁!"; }/////////////////////////////////////////////////////////////////// // php设置cookie ,php中cookie如何以数组的方式进行存储 $arr = array( 'name'=>'xxxx22', 'sex'=>'boys', 'age'=>21, ); //数组转换字符串存储 $cookie = serialize($arr); //设置cookie setcookie('cookies',$cookie,time()+60*60); print_r($cookies); setcookie('cookies','',time()-3600) //销毁cookie if(isset($cookies)){ print_r($cookies); }else{ echo "cookie已销毁!"; }