Subnet Calculator in 9 Lines of PHP
I’ve been spending a lot of time studying for my Microsoft 70-642 exam, an important part of which is subnetting.As an intellectual exercise I wrote a subnet calculator. Enjoy: 1 2 3 4 5 6 7 8 9 function subnet($hosts) { $bits = decbin($hosts) + 2; // Add 2 for Network ID and Broadcast $hostBits […]