What is the correct PHP function to destroy a session?

To destroy a session in PHP, you can use the session_destroy() function. This function will remove all session data and destroy the session. It is commonly used when a user logs out of a website or when you want to clear all session data.

<?php
session_start();
session_destroy();
?>