What are the differences in behavior between using a hyperlink and a button to call a logout script in PHP?

When using a hyperlink to call a logout script in PHP, the request is sent via a GET method which may expose sensitive information in the URL. On the other hand, using a button to call the logout script sends the request via a POST method, which is more secure and prevents sensitive information from being displayed in the URL.

// Using a button to call the logout script
<form method="post" action="logout.php">
    <button type="submit">Logout</button>
</form>