HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
PHP MySQLi Reference : Return a character set object, with several properties
The get_charset() / mysqli_get_charset() function returns a character set object with several properties for the current character set.
Object oriented style:
Procedural style:
Parameter | Description |
---|---|
connection | Required. Specifies the MySQL connection to use |
Return Value: | Returns a character set object with the following properties:
|
---|---|
PHP Version: | 5.1+ |
Return a character set object, with several properties:
<?php
$con = mysqli_connect("localhost","my_user","my_password","my_db");
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
exit();
}
var_dump(mysqli_get_charset($con));
mysqli_close($con);
?>
❮ PHP MySQLi Reference