Is it necessary to manually close database connections in PHP after each use, or is it done automatically?

It is necessary to manually close database connections in PHP after each use to free up resources and prevent potential issues with connection limits. This can be done using the `close()` method on the database connection object.

// Create a database connection
$connection = new mysqli($host, $username, $password, $database);

// Use the database connection

// Close the database connection
$connection->close();