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

不言
Release: 2023-04-03 17:56:01
Original
2349 people have browsed it

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>
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!