note 34747 added to function.ip2long

From: Date: Tue, 05 Aug 2003 18:51:11 +0000
Subject: note 34747 added to function.ip2long
Groups: php.notes 
Request: Send a blank email to php-notes+get-53442@lists.php.net to get a copy of this message
The reason 192.168.0.2 appears to fail is because of the top bit being used for the sign in the int type. It will fail for any address above 127.255.255.255. You can use the result as is for comparison checks but you need to use sprintf as detailed above if you want to do anything else with the number ie store in a DB. Regards ---- Manual Page -- http://www.php.net/manual/en/function.ip2long.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34747 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34747&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34747&report=yes

« previous php.notes (#53442) next »