In the example above, we established a database connection and performed some operations. Then, we closed the database connection using the PHP database close function. The function used in this example is mysqli_close(), which is part of the PHP MySQLi extension. Other libraries that offer database close functionality include the PDO extension, which comes with the PDO::close() function, and the legacy MySQL extension, which uses the mysql_close() function. However, these libraries are either depreciated or discouraged from use due to the security vulnerabilities or other issues they may pose.