weixin_41290949
漏刻有时
2019-05-06 12:32

php同样的字符串为什么编码不同?

  • apache
  • php
  • mvc
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"));

图片说明

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

2条回答

为你推荐