PHP - Function MySQLi Character Set Name



Syntax

mysqli_character_set_name(connection);

Definition and Usage

It is returns default character set for the database connection

Return Values

It returns default character set for the database connection

Parameters

Sr.No Parameters & Description
1

connection

It specifies the MySQL Connection to use

Example

Try out the following example

<?php
   $connection = mysqli_connect("localhost","user","password","db");
   
   if (mysqli_connect_errno($connection)){
      echo "Failed to connect to MySQL: " . mysqli_connect_error();
   }
   
   $charset = mysqli_character_set_name($connection);
   echo "Default character set is: " . $charset;
   
   mysqli_close($connection);
?>
php_function_reference.htm
Advertisements