What have you tried so far? Show us the code and weāll help figure out why itās not working, but no-one here will just write it for you.
Do you just want to delete it from the session variables, or is there a database table linked here? Iām not sure when you say ādelete item from tableā whether you are referring to the HTML table, or a database table.
OK, step one is to change your code so that it has a html form around each button, and contains a reference to the unique identifier in your $_SESSION array as a hidden variable. This will be similar to the code that you already have to add the items into the array.
When you have that working, have the form post to a short bit of PHP code that just displays the contents of the $_POST array, so you can see you are getting the correct id from the form.
One that is working correctly and showing the correct value, you can then add the code to remove it from the $_SESSION array and return to the original page to redraw the list. And when thatās working, you can add some JS code to remove it from the array without needing a redraw.
Do this bit first. Get your form tags in there, and add a hidden field with your $key value in it. Plenty of references around showing how to create a html form if you canāt use the āadd to cartā code as a reference.
This is because you open more brackets than you close on the line before it. But thereās no need to mess with the PHP until you have a form to post to it.