时间:2020-03-06加入收藏
即可完成,经测试后微信支付正常了!function b2_get_user_ip() {
if ( ! empty( $_SERVER[‘HTTP_CLIENT_IP’] ) ) {
$ip = $_SERVER[‘HTTP_CLIENT_IP’];
} elseif ( ! empty( $_SERVER[‘HTTP_X_FORWARDED_FOR’] ) ) {
$ip = $_SERVER[‘HTTP_X_FORWARDED_FOR’];
} else {
$ip = $_SERVER[‘REMOTE_ADDR’];
}
if(strpos($ip,’,’) !== false){
$ips = explode(‘,’,$ip);
$ip = $ips[0];
}
return $ip;
}
TGA: 技巧