According to the PHP manual, if you send a
header('HTTP/1.0 401 Unauthorized');
this will clear the authentication cache in the browser, and thus logging them out.
Both Netscape Navigator and Internet Explorer will clear the local browser window's authentication cache for the realm upon receiving a server response of 401. This can effectively "log out" a user, forcing them to re-enter their username and password. Some people use this to "time out" logins, or provide a "log-out" button.
Jamie