includes/functions.php
changeset 221 e5302cb1945c
parent 214 a6ed8b6cdbe1
child 227 0eca1498a77b
equal deleted inserted replaced
220:d44492e34ab3 221:e5302cb1945c
   430   $nums = explode('.', $ip);
   430   $nums = explode('.', $ip);
   431   if(sizeof($nums) != 4) return false;
   431   if(sizeof($nums) != 4) return false;
   432   $str = '0x';
   432   $str = '0x';
   433   foreach($nums as $n)
   433   foreach($nums as $n)
   434   {
   434   {
   435     $str .= (string)dechex($n);
   435     $byte = (string)dechex($n);
       
   436     if ( strlen($byte) < 2 )
       
   437       $byte = '0' . $byte;
   436   }
   438   }
   437   return $str;
   439   return $str;
   438 }
   440 }
   439 
   441 
   440 // Convert DWord to IP address
   442 // Convert DWord to IP address