$value = 'imooc';
setcookie('name',$value,time()+3600);
if(isset($_COOKIE['name'])){
echo $_COOKIE['name'];
}
setcookie('name',$value,time()+3600);
if(isset($_COOKIE['name'])){
echo $_COOKIE['name'];
}
2016-02-27
setcookie('test', '', time()-1); 注意中间还有一个参数,可以删掉
2016-02-23
当前的Cookie为:
Array
(
[CKFinder_Path] => /:/:1
[Hm_lvt_17ae0e9610817b676f961e42e01a0e3c] => 1456191398,1456208818,1456213437,1456215836
[l] => zh-cn
[PHPSESSID] => vc4st7hl72cmep6dfm5vlgo954
[test] => 1456227378
)
Array
(
[CKFinder_Path] => /:/:1
[Hm_lvt_17ae0e9610817b676f961e42e01a0e3c] => 1456191398,1456208818,1456213437,1456215836
[l] => zh-cn
[PHPSESSID] => vc4st7hl72cmep6dfm5vlgo954
[test] => 1456227378
)
2016-02-23
<?php
//设置默认的时区
date_default_timezone_set('Asia/Shanghai');
//输出1396193923对应的日期
echo date("Y-m-d H:i:s",'1396193923');
?>
//设置默认的时区
date_default_timezone_set('Asia/Shanghai');
//输出1396193923对应的日期
echo date("Y-m-d H:i:s",'1396193923');
?>
2016-02-23