Well, that's a bit of a different story.
If a user is explicitly logging out, then just do what you need during the code that logs them out. There isn't any need to put code in the session_end handler. (I am not even convinced that that method runs when a user logs out. Yes, they are logging out, but their session persists.)
Usually you would use session_end to execute cleanup code when a user session that ends after a period of user inactivity.
-Peter
peterlanoie.blog