复制代码 代码如下:
function cookie($var, $value='', $time=0, $path='', $domain=''){
$_COOKIE[$var] = $value;
if(is_array($value)){
foreach($value as $k=>$v){
setcookie($var.'['.$k.']', $v, $time, $path, $domain, $s);
}
}else{
setcookie($var, $value, $time, $path, $domain, $s);
}
}
//调用方法
cookie("website","WEB开发笔记","./","www.vevb.com");
//
echo $_COOKIE["website"];//输出WEB开发笔记
新闻热点
疑难解答