PHP mysqli_get_charset () function
Examples
Returns the character set object with attributes:
<?php
$con=mysqli_connect("localhost","my_user","my_password","my_db");
// 检测连接
if (mysqli_connect_errno($con))
{
echo "数据库连接失败: " . mysqli_connect_error();
}
var_dump(mysqli_get_charset($con));
mysqli_close($con);
?>
$con=mysqli_connect("localhost","my_user","my_password","my_db");
// 检测连接
if (mysqli_connect_errno($con))
{
echo "数据库连接失败: " . mysqli_connect_error();
}
var_dump(mysqli_get_charset($con));
mysqli_close($con);
?>
Definition and Usage
mysqli_get_charset () function returns the character object.
grammar
mysqli_get_charset( connection ) ;
参数 | 描述 |
---|---|
connection | 必需。规定要使用的 MySQL 连接。 |
technical details
return value: | Returns the character set object with the following properties:
|
---|---|
PHP version: | 5.1+ |
PHP MySQLi Reference Manual