So I'm trying to say if the count of $_SESSION['sql_history']) > 10 then remove the oldest element. But it doesn't remove anything what is my problem?
if(count($_SESSION['sql_history']) > 10){ unset($_SESSION['sql_history'][1]); }
The "oldest element" is probably $SESSION['sql_history'][0]. However, after you do that, the "oldest element" would be $SESSION['sql_history'][1]. Perhaps you should just use [man]array_shift/man instead.
I'll read up on array_shift. Thanks!!