Convert IP Address to Hex

/ Published in: PHP
Save to your folder(s)

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

Copy this code and paste it in your HTML
  1. $ip = ""
  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


RSS Icon Subscribe to comments

You need to login to post a comment.