This time to everyone to bring PHP to judge from what channel open two-dimensional code, PHP judge from what channels to open the two-dimensional code of note what, the following is the actual case, together to see.
#问题
Problems encountered in the project if the user is using Access.
Then a friendly tip " how to open with a browser/tell users to open with a browser "
Scheme
UserAgent is a browser identifier with some customer information. such as browser kernel, operating system, etc.
Access to the Web page is also a browser, it also has UA. Then the UA will be able to tell if it's being accessed.
$ua = $_server[' http_user_agent '); Micromessenger is the Android/iphone version of the//windows Phone is the winphone version of the belt (this logo will hurt Winphone ordinary browser access) if (Strpos ($ua, ' Micromessenger ') = = False | | Strpos ($ua, ' Windows Phone ') = = False) { echo "from normal browser access";} else{ echo "from browser access";}
Believe that you have read the case of this article you have mastered the method, more exciting please pay attention to the PHP Chinese network other related articles!
Recommended reading:
How to operate phpstudy2018 Access directory service permissions
thinkphp Implementing Payment (JSAPI Payment) steps