Unique entries in an array

后端 未结 4 1891
小蘑菇
小蘑菇 2021-01-26 08:43

I have the following that stores the previous 10 URL\'s into a session:

function curPageURL() {
 $pageURL = \'http\';
 if ($_SERVER[\"HTTPS\"] == \"on\") {$pageU         


        
4条回答
  •  滥情空心
    2021-01-26 09:28

    instead of $_SESSION['pages'][] = $CurrentPage try $_SESSION['pages'][$CurrentPage] = 1

    /edit: to keep items sorted, unset first:

     unset($_SESSION['pages'][$CurrentPage]);
     $_SESSION['pages'][$CurrentPage] = 1;
    

提交回复
热议问题