May 13, 2013
Is there a way to perform binary math on binary strings in PHP?
Skyline969’s Question:
I’m working with some numbers that would be far too large for PHP to handle (IPv6 addresses in binary), so to work around this I’ve formulated a function to convert the addresses to/from binary strings (literally just a string of 1s and 0s). However, when it comes to subnet calculations the easiest way I know how to do this is to use binary math. I have no idea how I’d use binary math in this instance since I’m technically dealing with strings, not binary numbers. Is there any way I can do binary math with a string representation of a binary number?