public function IsWeixinOrAlipay()
{
$ua = $_SERVER[‘HTTP_USER_AGENT‘];
if (strpos($ua, ‘MicroMessenger‘)) {
echo ‘微信‘;
}
elseif (strpos($ua, ‘AlipayClient‘)) {
echo "支付寶";
}
elseif (strpos($ua, ‘QQ/‘)) {
echo "QQ";
}else{
echo "其他";
}
}