In the micro-credit development of the public account, which is a large number of micro-site development, we need to know that the current browser is a micro-mail built-in browser, then how to judge?
User Agent for micro-trust built-in browsers
How to determine the micro-trust built-in browser, first need to obtain a micro-mail built-in browser user agent, after the IPhone on the micro-mail browser detection, its user agent is:
mozilla/5.0 (IPhone; CPU iPhone os 6_1_3 like Mac os X) applewebkit/536.26 (khtml, like Gecko) mobile/10b329 micromessenger/5.0.1
So by identifying Micromessenger this keyword to determine whether the micro-letter built-in browser.
Judging by JavaScript
function Is_weixin () {
var ua = Navigator.userAgent.toLowerCase ();
if (Ua.match (/micromessenger/i) = = "Micromessenger") {return
true;
} else {return
false
;
}}
Judging by PHP
function Is_weixin () {
if (Strpos ($_server[' http_user_agent '], ' Micromessenger ')!== false) {return
true;< c14/>} return
false;
}