mysqli_get_charset()
实例
返回带有属性的字符集对象:
<?php
$con=mysqli_connect("localhost","my_user","my_password","my_db");
// Check connection
if (mysqli_connect_errno($con))
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
var_dump(mysqli_get_charset($con));
mysqli_close($con);
?>
$con=mysqli_connect("localhost","my_user","my_password","my_db");
// Check connection
if (mysqli_connect_errno($con))
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
var_dump(mysqli_get_charset($con));
mysqli_close($con);
?>
定义和用法
mysqli_get_charset() 函数返回字符集对象。
语法
mysqli_get_charset(connection);
参数 | 描述 |
---|---|
connection | 必需。规定要使用的 MySQL 连接。 |
技术细节
返回值: |
返回带有下列属性的字符集对象:
|
---|---|
PHP 版本: | 5.1+ |