PHP mysqli_get_charset() Function

PHP mysqli_get_charset() function returns a character set object providing several properties of the current active character set.

Syntax

mysqli_get_charset() Function Parameter

ParameterDescription
Connection :Required parameter. The MySQL connection to be used.

mysqli_get_charset() Function Return Value

Return Values :Returns a character set object with the following properties:

  • charset - character set name
  • collation - collation name
  • dir - directory the charset description was fetched from (?) or "" for built-in character sets
  • min_length - min character length in bytes
  • max_length - max character length in bytes
  • number - internal character set number
  • state - character set status

mysqli_get_charset() Function Example