日期:2014-05-17 浏览次数:20496 次
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';
}