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

查看所有标签

Introduction to Algorithms, 3rd Edition

Introduction to Algorithms, 3rd Edition

Thomas H. Cormen、Charles E. Leiserson、Ronald L. Rivest、Clifford Stein / The MIT Press / 2009-7-31 / USD 94.00

Some books on algorithms are rigorous but incomplete; others cover masses of material but lack rigor. Introduction to Algorithms uniquely combines rigor and comprehensiveness. The book covers a broad ......一起来看看 《Introduction to Algorithms, 3rd Edition》 这本书的介绍吧!

URL 编码/解码
URL 编码/解码

URL 编码/解码

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具