您好!欢迎来到e资源!本站资源24小时自动发货,海量精品课程资源免费下载!

PHP创建,读取和销毁Cookie数组的方法

创建:setcookie("ICNet[Reg]", "This is reg cookie", time() + 3600); setcookie("ICNet[Active]", "This is login cookie.", tim...
创建:

setcookie("ICNet[Reg]", "This is reg cookie", time() + 3600);   setcookie("ICNet[Active]", "This is login cookie.", time() + 3600);   print_r($_COOKIE);     /*Result: Array (  [ICNet] => Array ( [Reg] => This is reg cookie [Active] => This is login cookie ) [PHPSESSID] => nsi2q5upuvqrik6notaohjd7p3 )  */   读取:     echo $_COOKIE['ICNet']['Reg'];   echo $_COOKIE['ICNet']['Active'];   //或者   $arr_cookie = $_COOKIE['ICNet'];   echo $arr_cookie['Reg'];   echo $arr_cookie['Active'];     销毁:   setcookie('ICNet[Reg]', '', time() - 3600);   setcookie('ICNet[Active]', '', time() - 3600);  
开通vip
首页 导航 会员 客服 微信
QQ 微信 邮箱 TOP