Difficulty: Super easy
This is just something very quick and basic. Here is a logout code. I added in comments.
[php]<?php
session_start();
//That continues on the started session
session_destroy();
//That destroyed the session
header(‘Refresh: 3; index.php’);
exit();
//That means that you will be redirected to the main page in 3 seconds
echo “Logged out. Redirecting in 3 seconds”;
//That should be straightforward
?>[/php]
I know this is very basic.