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
You've ommitted session_start();. Working code (without trimming):
session_start();
$value) { echo 'The value of $_SESSION['."'".$key."'".'] is '."'".$value."'".' '; } ?>