时间:2021-07-01 10:21:17 帮助过:8人阅读
if(isset($_COOKIE['history']))
{
$history = explode(',', $_COOKIE['history']);
array_unshift($history, $id);
$history = array_unique($history);
while (count($history) > 5)
{
array_pop($history);
}
setcookie('history',implode(',', $history),80000);
echo 'add';
}
else
{
setcookie('history',$id,80000);
echo 'new';
}