Converting IP Address Formats

Trackback or
If you found this post useful, why don't you buy me a cup of coffee to show your gratitude?

Trackback link - http://www.dailycupoftech.com/converting-ip-address-formats/trackback/
Tim Fehlman

3 Responses to “Converting IP Address Formats”

  1. Ian Mahuron Says:

    It’s not unusual to store IP addresses in a database using a network long. First, it’s space efficient. Second, an integer format allows you to easily (and inexpensively) query for IPs which fall into a given subnet or address range. Doing this with DDN (dotted decimal notation) formatted columns is far more difficult.

    A DllCall to wsock32.dll’s inet_ntoa() function will simplify your code (even eliminate the intermediate dec2hex conversion). This DLL has additional similar functions for address manipulation.

  2. Lucian Says:

    Or you can use the following php function

    function address2number($ip){
    $retVal = false;
    list($a,$b,$c,$d) = explode('.', $ip);
    if(is_int($a) && is_int($b) && is_int($c) && is_int($d)){
    $retVal = ($a

    I use this code on my website: Ip global positioning . I have also google maps API to show the exact location.

  3. Daily Cup of Tech Says:

    35 Web Based Application Alternatives 9 Ways To Think Outside The Box About Daily Cup of Tech AutoIt UDF’s; A Lot of Power in One Line Build a USB Drive Mail System Configure Autoplay With TweakUI Configuring Disks in FreeNAS Converting IP Address Formats Create a Self-Burning ISO with AutoIt Creating a Basic TrueCrypt Volume on a USB Drive Creating Windows Shares on FreeNAS DCoT Discounts DCoT Webmaster Tools Disable IE7 Installation Via Windows Update

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>