array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'mysqli.get-client-version.php', 1 => 'mysqli::$client_version', ), 'up' => array ( 0 => 'class.mysqli.php', 1 => 'mysqli', ), 'prev' => array ( 0 => 'mysqli.get-client-info.php', 1 => 'mysqli::$client_info', ), 'next' => array ( 0 => 'mysqli.get-connection-stats.php', 1 => 'mysqli::get_connection_stats', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'zh', 'path' => 'reference/mysqli/mysqli/get-client-version.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 5, PHP 7, PHP 8)
mysqli::$client_version -- mysqli_get_client_version — 作为整数返回 MySQL 客户端的版本
此函数没有参数。
表示 MySQL 客户端库版本的数字,格式为
main_version*10000 + minor_version *100 + sub_version
。例如:4.1.0 返回 40100。
这有助于快速确定客户端库的版本来辨别是否有某些特性存在。
示例 #1 mysqli_get_client_version
<?php
/* We don't need a connection to determine
the version of mysql client library */
printf("Client library version: %d\n", mysqli_get_client_version());
?>