PHP mysqli_get_charset() 函数

PHP 教程 · 2019-01-27 23:27:18

实例

返回带有属性的字符集对象:

<?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);
?>

定义和用法

mysqli_get_charset() 函数返回字符集对象。

语法

mysqli_get_charset(connection);

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

技术细节

返回值: 返回带有下列属性的字符集对象:
  • charset - 字符集名称
  • collation - 排序规则名称
  • dir - 被获取的目录字符集或者 ""
  • min_length - 以字节计的最小字符长度
  • max_length - 以字节计的最大字符长度
  • number - 内部字符集数
  • state - 字符集状态
PHP 版本: 5.1+

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

查看所有标签

The Art of Computer Programming, Volume 4,  Fascicle 3

The Art of Computer Programming, Volume 4, Fascicle 3

Donald E. Knuth / Addison-Wesley Professional / 2005-08-05 / USD 19.99

Finally, after a wait of more than thirty-five years, the first part of Volume 4 is at last ready for publication. Check out the boxed set that brings together Volumes 1 - 4A in one elegant case, and ......一起来看看 《The Art of Computer Programming, Volume 4, Fascicle 3》 这本书的介绍吧!

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

在线压缩/解压 CSS 代码

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

URL 编码/解码

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试