I'm on a role today with help threads. 
I now have a problem with long ints. One of my for loops was running much longer than it should and it turned out it was because one of my functions was returning an incorrect offset. This offset is read from a binary file. Using a hex editor the value is 2577852 which is correct.
Using the unpack() function with $format = V it returns 823680 which is wrong. I've tried all the other options available but they all return the same. From the looks of it this long int is 64-bit which is probably why it's returning the wrong value. It seems PHP doesn't have any native functions to convert the binary to a decimal so I'm kinda stuck.
Am I going to have to create a custom function or is there a work around?

I now have a problem with long ints. One of my for loops was running much longer than it should and it turned out it was because one of my functions was returning an incorrect offset. This offset is read from a binary file. Using a hex editor the value is 2577852 which is correct.
Using the unpack() function with $format = V it returns 823680 which is wrong. I've tried all the other options available but they all return the same. From the looks of it this long int is 64-bit which is probably why it's returning the wrong value. It seems PHP doesn't have any native functions to convert the binary to a decimal so I'm kinda stuck.
Am I going to have to create a custom function or is there a work around?