1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PHP to convert IPv4 to Xenforo storable format

Discussion in 'General PHP and MySQL Discussions' started by HostingItAll, Mar 22, 2016.

  1. HostingItAll

    HostingItAll Member


    I am able to pull IP's out of the Xenforo database using
    $iparray[] = long2ip(hexdec(bin2hex($row['ip'])));

    I want to be able to store IP addresses using my API, this uses PHP and MYSQL queries.

    How can I do the reverse of above to convert the IP to the correct format to store?

    ip2long($ip) is incorrect and needs something further.

Share This Page