PHP mysqli_get_charset() Function

The mysqli_get_charset() function returns a character set object.

Object oriented style

object mysqli::get_charset ( void )

Procedural style

object mysqli_get_charset ( mysqli $link )

Returns a character set object providing several properties of the current active character set.

Examples -

Object oriented style

Procedural style

The above examples will output:

object(stdClass)#2 (7) {
  ["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(801)
}

ParameterDescription
linkProcedural style only: A link identifier returned by mysqli_connect() or mysqli_init()