PHP mysqli_character_set_name() 函数

PHP 教程 · 2019-01-27 17:13:04

实例

返回数据库连接的默认字符集:

<?php
$con
=mysqli_connect("localhost","my_user","my_password","my_db");

// 检查连接
if (mysqli_connect_errno($con))
{
    echo 
"连接数据库失败: " mysqli_connect_error();
}

$charset=mysqli_character_set_name($con);
echo 
"默认字符集为: " $charset;

mysqli_close($con);
?>

定义和用法

mysqli_character_set_name() 函数返回数据库连接的默认字符集。

语法

mysqli_character_set_name(connection);

参数 描述
connection 必需。规定要使用的 MySQL 连接。

技术细节

返回值: 指定连接的默认字符集。
PHP 版本: 5+

点击查看所有 PHP 教程 文章: https://www.codercto.com/courses/l/5.html

查看所有标签

Data Structures and Algorithms in Python

Data Structures and Algorithms in Python

Michael T. Goodrich、Roberto Tamassia、Michael H. Goldwasser / John Wiley & Sons / 2013-7-5 / GBP 121.23

Based on the authors' market leading data structures books in Java and C++, this book offers a comprehensive, definitive introduction to data structures in Python by authoritative authors. Data Struct......一起来看看 《Data Structures and Algorithms in Python》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

在线进制转换器
在线进制转换器

各进制数互转换器

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具