Show recent viewed product list on website in php
I am writing down the code to show the recent viewed product on the e-commerce websites. if(!$_COOKIE[‘recentviews’]){ setcookie(‘recentviews’,$_GET[‘pid’],time()+86400); }else{ $cArray=explode(“,”,$_COOKIE[‘recentviews’]); if(!in_array($_GET[‘pid’],$cArray)){ setcookie(‘recentviews’,$_COOKIE[‘recentviews’].”,”.$_GET[‘pid’], time()+86400); } } ?> Note:before using $_COOKIE start





