0; $i++) { $b = $ipBytes[$i]; if ($curPrefix < 8) { $shiftN = 8 - $curPrefix; $b = \chr(0xFF & (\ord($b) >> $shiftN) << $shiftN); } $networkBytes[$i] = $b; $curPrefix -= 8; } $network = inet_ntop($networkBytes); return "$network/$prefixLen"; } }