MySQLi - 獲取字元集



語法

object mysqli_get_charset ( mysqli $link )

定義和用法

它返回一個字元集物件。

示例

嘗試以下示例 -

<?php
   $db = mysqli_init();
   $servername = "localhost:3306";
   $username = "root";
   $password = "";
   $dbname = "TUTORIALS";

   $conn = mysqli_real_connect($db,$servername, $username, $password, $dbname);
   var_dump(mysqli_get_charset($db));
?>

上述程式碼的示例輸出應如下所示 -

object(stdClass)#2 (8) { 
   ["charset"]=> string(6) "latin1" ["collation"]=> string(17) "latin1_swedish_ci" 
   ["dir"]=> string(0) "" ["min_length"]=> int(1) ["max_length"]=> int(1) 
   ["number"]=> int(8) ["state"]=> int(1) ["comment"]=> string(0) "" 
}
mysqli_useful_functions.htm
廣告
© . All rights reserved.