You are here : phpmysqlimysqli_character_set_name

mysqli_character_set_name() - mysqli

The mysqli_character_set_name() function returns the default character set for the database connection.


Syntax

mysqli_character_set_name(connection);


Example

<?php
$con=mysqli_connect("localhost","my_user","my_password","my_db");
// Check connection
if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }

$charset=mysqli_character_set_name($con);
echo "Default character set is: " . $charset;

mysqli_close($con);
?>


Output / Return Value


Limitations


Alternatives / See Also


Reference