php 判断是不是 微信
if (strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') !== false) { $wx = WX_AUTHORIZE . "?appid=" . WX_APP_ID . "&redirect_uri=" . $urlencode . "&response_type=code&scope=snsapi_userinfo&state=STATE&connect_redirect=1#wechat_redirect"; header("Location:" . $wx); }
js判断是不是微信
function isWeChat() { var userAgentInfo = navigator.userAgent; var Agents = new Array("MicroMessenger"); var flag = false; for (var v = 0; v < Agents.length; v++) { if (userAgentInfo.indexOf(Agents[v]) > 0) { flag = true; break; } } return flag; }js判断是不是微博
function is_weibo(){ var ua = navigator.userAgent; if(ua.indexOf('Weibo') > -1) { return true; } else { return false; } }