时间:2021-07-01 10:21:17 帮助过:25人阅读
function get_net($ip,$hide="255.255.255.255") {
$a = explode(".",$ip);
$b = explode(".",$hide);
for($i=0;$i<4;$i++)
$r[$i] = (int)$a[$i] & (int)$b[$i];
return join(".",$r);
}
?>
http://www.bkjia.com/PHPjc/532403.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/532403.htmlTechArticle?php /* 如:192.16.1.13 与:255.255.255.0 进行,,与算,,要求出它为192.16.1.0 */ $ip = "192.16.1.13"; echo get_net($ip,"255.255.255.0"); function get_net($ip,$hide="255.255.2...