The content of this article is about how the thinkphp template determines whether it is mobile WeChat payment or WeChat scan code payment. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.
If the function is customized
Is it iswechat() in WeChat
Is it the mobile browser ismobile()
Then, I make a judgment in the template, based on different clients, Display different content
That is, if it is not a mobile phone, only the scan code WeChat payment will be displayed. If it is a WeChat official account, only the official account payment will be displayed. The writing is as follows
<select class="email s-email" name="content" > <option value="alipay_charge">支付宝</option> {if ismobile()} {if iswechat()} <option value="wechat_jsapi">微信公众号支付</option> {else/} <option value="wechat_h5" >微信H5支付</option> {/if} {else/} <option value="wechat_native">微信扫码支付</option> {/if} </select>
Related recommendations:
Code examples of non-forwarding calls and forwarding calls in php
Code for combining php and html to upload image files to the server
The above is the detailed content of How does the thinkphp template determine whether it is mobile WeChat payment or WeChat scan code payment?. For more information, please follow other related articles on the PHP Chinese website!