Blogger Information
Blog 87
fans 0
comment 0
visits 59531
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
第八章:1. cookie的工作原理与常用操作
黄忠倚的博客
Original
870 people have browsed it

实例

<?php
//1.设置cookies
setcookie('userName','Kevin Wong',time()+3600);
setcookie('email','KevinW@php.cn');

//2.查看:$_cookie
echo '用户名:', $_COOKIE['userName'],'<br>';
echo '邮箱:', $_COOKIE['email'],'<br>';

//3.更新
//$_COOKIE['userName'] = 'aaa';
setcookie('userName','Kevin Wong');

//4.删除
//方法:1
//setcookie('userName');
//方法:2
//setcookie('userName');
//方法:3
setcookie('userName','',time()-3600);

运行实例 »

点击 "运行实例" 按钮查看在线实例


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post