Hazelwire/Hazelwire — Issue #3: IP machting sux balls
Author: Sjikke
Created: 2011-12-16 15:56:24+00:00
State: open

See title

$network = explode("/", $ranges[$i]);
$ip_binary_string = sprintf("%032b",ip2long($ip));
$net_binary_string = sprintf("%032b",ip2long($network[0]));
if( substr_compare($ip_binary_string,$net_binary_string,0,$network[1]) === 0)
$match=true;