<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="mysqli.get-charset" xmlns="http://docbook.org/ns/docbook">
 <refnamediv>
  <refname>mysqli::get_charset</refname>
  <refname>mysqli_get_charset</refname>
  <refpurpose>Returns a character set object</refpurpose>
 </refnamediv>

 <refsect1 role="description">
  &reftitle.description;
  <para>&style.oop;</para>
  <methodsynopsis role="mysqli">
   <modifier>public</modifier> <type class="union"><type>object</type><type>null</type></type><methodname>mysqli::get_charset</methodname>
   <void/>
  </methodsynopsis>
  <para>&style.procedural;</para>
  <methodsynopsis>
   <type class="union"><type>object</type><type>null</type></type><methodname>mysqli_get_charset</methodname>
   <methodparam><type>mysqli</type><parameter>mysql</parameter></methodparam>
  </methodsynopsis>

  <para>
   Returns a character set object providing several properties 
   of the current active character set.
  </para> 

 </refsect1>

 <refsect1 role="parameters">
  &reftitle.parameters;
  <para>
   <variablelist>
    &mysqli.link.description;
   </variablelist>
  </para>
 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   The function returns a character set object with the following properties:
   <variablelist>
    <varlistentry>
     <term><parameter>charset</parameter></term>
     <listitem><para>Character set name</para></listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>collation</parameter></term>
     <listitem><para>Collation name</para></listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>dir</parameter></term>
     <listitem><para>Directory the charset description was fetched from (?) or "" for built-in character sets</para></listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>min_length</parameter></term>
     <listitem><para>Minimum character length in bytes</para></listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>max_length</parameter></term>
     <listitem><para>Maximum character length in bytes</para></listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>number</parameter></term>
     <listitem><para>Internal character set number</para></listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>state</parameter></term>
     <listitem><para>Character set status (?)</para></listitem>
    </varlistentry>
   </variablelist>
  </para>
 </refsect1>

 <refsect1 role="examples">
  &reftitle.examples;
  <example>
   <title><methodname>mysqli::get_charset</methodname> example</title>
   <para>&style.oop;</para>
   <programlisting role="php">
<![CDATA[
<?php
  $db = mysqli_init();
  $db->real_connect("localhost","root","","test");
  var_dump($db->get_charset());
?>
]]>
   </programlisting>
   <para>&style.procedural;</para>
   <programlisting role="php">
<![CDATA[
<?php
  $db = mysqli_init();
  mysqli_real_connect($db, "localhost","root","","test");
  var_dump(mysqli_get_charset($db));
?>
]]>
   </programlisting>
   &examples.outputs;
   <screen>
<![CDATA[
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)
}
]]>
   </screen>
  </example>
 </refsect1>

 <refsect1 role="seealso">
  &reftitle.seealso;
  <para>
   <simplelist>
    <member><function>mysqli_character_set_name</function></member>
    <member><function>mysqli_set_charset</function></member>
   </simplelist>
  </para>
 </refsect1>

</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
