Copy CodeThe code is as follows:
function Set_cronology ($name, $value, $duration =7) {
$duration =time () + (3600*24* $duration);
$max _stored_values=5;
if (Isset ($_cookie[$name])) {
foreach ($_cookie[$name] as $prop _crono=> $val _crono) {
if ($val _crono== $value)
Return
}
if ($prop _crono< $max _stored_values)
Setcookie ($name. ' ['. ($prop _crono+1). '] ', $value, $duration);
else{
Array_shift ($_cookie[$name]);
Setcookie ("$name [$max _stored_values]", $value, $duration);
}
}else
Setcookie ($name. ' [0] ', $value, $duration);
Return
}
?>
http://www.bkjia.com/PHPjc/323295.html www.bkjia.com true http://www.bkjia.com/PHPjc/323295.html techarticle Copy the code as follows: Php function Set_cronology ($name, $value, $duration =7) {$duration =time () + (3600*24* $duration); $max _ stored_values=5; if (Isset ($_cookie[$name])) {foreach ($_ ...