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>"
."";?>
. "<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>"
."";?>
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);
}
}
原来是这样的 我不懂 就在下面加上了
如果不同可以改为一样就可以了。例如你php文件保存为utf8格式
然后header输出
<?php
header('content-type:text/html;charset=utf8');
?>
<meta http-equiv="content-type" content="text/html;charset=utf-8">这样就不会乱码了
<!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>.........
';
如果不同可以改为一样就可以了。例如你php文件保存为utf8格式
然后header输出
<?php
header('content-type:text/html;charset=utf8');
?>
<meta http-equiv="content-type" content="text/html;charset=utf-8">这样就不会乱码了