iconv("UTF-8","BIG5", $T) 轉換編碼-PHP教學

iconv("UTF-8","BIG5", $T) 轉換編碼-PHP教學

//============UTF-8 轉 BIG5 (UTF-8轉繁體中文): 
$T = iconv("UTF-8","BIG5", $T);

//============BIG5 轉 gb2312 (繁體中文轉簡體中文): 
$T = iconv(BIG5","gb2312", $T);

//============gb2312 轉 UTF-8 (簡體轉 UTF-8): 
$T = iconv("gb2312","UTF-8", $T);

//==UTF-8不能直接來作轉換,得先轉 BIG5 or gb2312

//============UTF-8 的 BIG5  轉 UTF-8 的 gb2312: 
$T = iconv("gb2312","UTF-8",iconv("BIG5","gb2312",iconv("UTF-8","BIG5", $T)));

//============UTF-8 的 gb2312 轉 UTF-8 的 BIG5 :
$T = iconv("BIG5","UTF-8",iconv("gb2312","BIG5",iconv("UTF-8","gb2312", $T)));