echo"<body>"
  . "<div class=\"weixin-tip\">"
  . " <p>"
  . " <img src=\"live_weixin.png\" alt=\"微信打开\"/>"
  . " </p>"
  . "</div>"
  . "<script type=\"text/javascript\">"
  . "       $(window).on(\"load\",function(){"
  . "        var winHeight = $(window).height();"
  . " function is_weixin() {"
  . "     var ua = navigator.userAgent.toLowerCase();"
  . "     if (ua.match(/MicroMessenger/i) == \"micromessenger\") {"
  . "         return true;"
  . "     } else {"
  . "         return false;"
  . "     }"
  . " }"
  . " var isWeixin = is_weixin();"
  . " if(isWeixin){"
  . " $(\".weixin-tip\").css(\"height\",winHeight);"
  . "            $(\".weixin-tip\").show();"
  . " }"
  . "       })"
  . "</script>"
  . "/body>"
 ."";?>

解决方案 »

  1.   

    请检查php文件编码是否是utf8,请检查网页编码是否是utf8。
      

  2.   

     }
        static function isMicroMessenger()
        {
            $ua = @$_SERVER['HTTP_USER_AGENT'];
            return preg_match('/MicroMessenger/i', $ua);
        }    static function isIPhone()
        {
            $ua = @$_SERVER['HTTP_USER_AGENT'];
            return preg_match('/iPhone/i', $ua);
        }    static function isIPad()
        {
            $ua = @$_SERVER['HTTP_USER_AGENT'];
            return preg_match('/(iPad|)/i', $ua);
        }
    }
    原来是这样的 我不懂 就在下面加上了
      

  3.   

    看看文件编码,meta编码,和header输出编码是否一致。
    如果不同可以改为一样就可以了。例如你php文件保存为utf8格式
    然后header输出
    <?php
    header('content-type:text/html;charset=utf8');
    ?>
    <meta http-equiv="content-type" content="text/html;charset=utf-8">这样就不会乱码了
      

  4.   

    编码的问题:要不你顺带添加上头echo '
                <!DOCTYPE html>
                <html lang="zh-CN">
                    <head>
                        <meta charset="utf-8">
                        <meta name="format-detection" content="email=no" />
                        <meta name="format-detection" content="telephone=no" />
                        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
                        <title>用卡啦提示</title>
                        <script type="text/javascript" src="/themes/default/js/jquery.min.js" ></script>
                    </head>
                    <body>
                        <style>.........
              ';
      

  5.   

    看看文件编码,meta编码,和header输出编码是否一致。
    如果不同可以改为一样就可以了。例如你php文件保存为utf8格式
    然后header输出
    <?php
    header('content-type:text/html;charset=utf8');
    ?>
    <meta http-equiv="content-type" content="text/html;charset=utf-8">这样就不会乱码了