PHP mysqli_get_host_info() 函数

定义和用法

mysqli_get_host_info() 函数返回 MySQL 服务器主机名和连接类型。


语法

mysqli_get_host_info(connection);

返回 MySQL 服务器主机名和连接类型:

<?php
$con=mysqli_connect("localhost","my_user","my_password","my_db");
// 检测连接
if (mysqli_connect_errno($con))
{
     echo "数据库连接失败: " . mysqli_connect_error();
}

echo mysqli_get_host_info($con);

mysqli_close($con);
?>
原文地址:https://www.cnblogs.com/furuihua/p/11194976.html