第一:设置

<?php
header('Content-Type:text/html;charset=utf-8');
setcookie("menber[name]","陈业贵",time()+2000);

PHP cookie技术_html

2.获取

<?php
header('Content-Type:text/html;charset=utf-8');
var_dump($_COOKIE['menber']['name']);

PHP cookie技术_开发语言_02

删除cookie

<?php
header('Content-Type:text/html;charset=utf-8');
setcookie("member[name]",'陈业贵',time()-1);
var_dump($_COOKIE['member']['name']);

PHP cookie技术_php_03