Posted By

martyncoup on 10/31/13


Tagged

php hex to ip convert address


Versions (?)

Convert IP Address to Hex


 / Published in: PHP
 

Covnerts an IP address to it's relative hex value.

  1. $ip = "192.168.1.12"
  2. $ip_split = explode('.', $ip);
  3. $HEXIP = sprintf('%02x%02x%02x%02x', $ip_split[0], $ip_split[1], $ip_split[2], $ip_split[3]);

Report this snippet  

You need to login to post a comment.