我已迁移到使用 PHP v7(来自我的 PHP v5.4)的新服务器,现在我的网站上显示错误。
这是返回错误的代码行:
// The value of $ip at this point would look something like: "192.0.34.166"
$ip = ip2long($ip);
// The $ip would now look something like: 1073732954
if(!count($ip) > 0 || !preg_match('/^\d+$/', $ip) || empty($ip)) {
$ip="0000000000";
}
我该如何解决这个问题?