However, this mechanism will always bring us this or that problem, such as the previous period of time, my site to set up an ad display function, you need to use cookies, the main purpose is to increase the conversion rate of advertising, but if the refresh takes effect, it is more troublesome, so the use of this method, useful.
Here's the code:
Copy CodeThe code is as follows:
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);
}
}
Calling methods
Cookies ("website", "Web Development Notes", "./", "www.jb51.net");
//
echo $_cookie["website"];//output Web Development note
http://www.bkjia.com/PHPjc/325049.html www.bkjia.com true http://www.bkjia.com/PHPjc/325049.html techarticle However, this mechanism will always bring us this or that problem, such as some time ago, my site to set up an ad display function, you need to use cookies, the main purpose is to ...