header("Content-type:text/html;charset=utf-8"); $secret1 = "rZa9GneIzd9MNyoTv/Ghpk2V6ZHD0KeQC7t0ymEH7cI="; $secret2 = 'rZa9GneIzd9MNyoTv/Ghpk2V6ZHD0KeQC7t0ymEH7cI='; $secret3 = 'rZa9GneIzd9MNyoTv/Ghpk2V6ZHD0KeQC7t0ymEH7cI='; var_dump(trim($secret1)); echo "<br>"; var_dump(trim($secret2)); echo "<br>"; var_dump($secret3); echo "<br>"; echo mb_detect_encoding($secret1, array("ASCII", "UTF-8", "GB2312", "GBK", "BIG5")); echo "<br>"; echo mb_detect_encoding($secret2, array("ASCII", "UTF-8", "GB2312", "GBK", "BIG5")); echo "<br>"; echo mb_detect_encoding($secret3, array("ASCII", "UTF-8", "GB2312", "GBK", "BIG5"));
同樣的字串,在偵測編碼時,顯示的編碼不同,是什麼問題導致的?
針對不同字元集, 會有不同的編碼方案, 現在通用的是UTF8