Im doing an API GET call to get some IP addresses. These are stored in a MySQL database, as Binary(16) type. Example:
0x00000000000000000000ffff0104ce7f
As this is in HEX format, by converting ffff0104ce7f
I get the IP address (in this instance it converts to 1.4.206.127
)
When I make the API GET call I get
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00??\x01\x04?\x7F
This is the hex i get, when trying to get the above mentioned IP address that is stored as
0x00000000000000000000ffff0104ce7f
in the database.
Im importing the data into a PHP website.
How do I convert the HEX string (\x00\x00..
) into something readable in PHP, preferably an IP address as a string, e.g. 1.4.206.127
?
Above problem should have worked with this
solution but apparently it didn't ... SO I am thinking maybe the response
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00??\x01\x04?\x7F
you are getting is not correct... but then I could be wrong!