How to add visited pages urls into a session array?

前端 未结 3 746
北荒
北荒 2021-01-23 07:05

Everytime the user visit a page, the page url will be stored into an array session. I want to have 10 elements in the array only. So that 10 elements will save 10 latest visited

3条回答
  •  情深已故
    2021-01-23 07:30

    You've ommitted session_start();. Working code (without trimming):

    $value) {
        echo 'The value of $_SESSION['."'".$key."'".'] is '."'".$value."'".' 
    '; } ?>

提交回复
热议问题