phpと文字コード

とある変数の文字コードを取得したい。

<?php
mb_detect_encoding($www);

【参考サイト】
http://manual.xwd.jp/function.mb-detect-encoding.html


文字エンコーディングを変換したい。

<?php
$result = mb_convert_encoding($www, "SJIS", "auto");

【参考サイト】
http://manual.xwd.jp/function.mb-convert-encoding.html


内部文字エンコーディングを取得したい 。

<?php
$result = mb_convert_encoding($www, "SJIS", "auto");

【参考サイト】
http://manual.xwd.jp/function.mb-internal-encoding.html


クライアントの文字セットを設定する 。

<?php
mysql_set_charset('SJIS',$con);

【参考サイト】
http://php.benscom.com/manual/ja/function.mysql-set-charset.php