note 20198 added to function.long2ip

From: Date: Tue, 26 Mar 2002 10:01:48 +0000
Subject: note 20198 added to function.long2ip
Groups: php.notes 
Request: Send a blank email to php-notes+get-28220@lists.php.net to get a copy of this message
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); -- http://www.php.net/manual/en/function.long2ip.php http://master.php.net/manage/user-notes.php?action=edit+20198 http://master.php.net/manage/user-notes.php?action=delete+20198 http://master.php.net/manage/user-notes.php?action=reject+20198

« previous php.notes (#28220) next »