note 20198 deleted from function.long2ip by nlopess
| From: | nlopess@php.net | Date: | Fri, 13 Aug 2004 23:11:21 +0000 |
| Subject: | note 20198 deleted from function.long2ip by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-74593@lists.php.net to get a copy of this message | ||
Note Submitter: lee.brotherston@uk.easynet.net
----
Under certain circumstances (which I think are OS dependent) long2ip cannot convert to addresses
larger than 127.255.255.255 when presented as a string without using negative figures. As
illustrated in the following:
<?
$moo = "3232235521";
echo long2ip($moo);
echo " - ";
$moo = 3232235521;
echo long2ip($moo);
?>
The work around to this is to use settype after assigning the value to the string, like so:
$moo = "3232235521";
settype($moo, "double");
echo long2ip($moo);