时间:2021-07-01 10:21:17 帮助过:19人阅读
print_r($dataIp);
foreach ($dataIp as $key=>$value) {
$data['ip'] = $value;
$data['iplong'] = bindec(decbin(ip2long($value)));
print_r($data);
}
Array
(
[ip] => 208.104.70.215
[iplong] => 3496494807
)
Array
(
[ip] => 74.101.176.171
[iplong] => 1248178347
)
Array
(
[ip] => 73.17.35.30
[iplong] => 1225859870
)
Array
(
[ip] => 70.198.197.3
[iplong] => 1187431683
)
Array
(
[ip] => 46.44.179.76
[iplong] => 774681420
)
$dataIp = array('208.104.70.215', '74.101.176.171', '73.17.35.30', '70.198.197.3', '46.44.179.76');
foreach ($dataIp as $key=>$value) {
$data['ip'] = $value;
$data['iplong'] = bindec(decbin(ip2long($value)));
print_r($data);
}
Array
(
[ip] => 208.104.70.215
[iplong] => 3496494807
)
Array
(
[ip] => 74.101.176.171
[iplong] => 1248178347
)
Array
(
[ip] => 73.17.35.30
[iplong] => 1225859870
)
Array
(
[ip] => 70.198.197.3
[iplong] => 1187431683
)
Array
(
[ip] => 46.44.179.76
[iplong] => 774681420
)