Home  >  Article  >  Backend Development  >  How does the thinkphp template determine whether it is mobile WeChat payment or WeChat scan code payment?

How does the thinkphp template determine whether it is mobile WeChat payment or WeChat scan code payment?

不言
不言Original
2018-08-10 10:50:482358browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn