note 26877 added to function.ip2long
| From: | pinhole at inebraska dot com | Date: | Fri, 15 Nov 2002 14:49:15 +0000 |
| Subject: | note 26877 added to function.ip2long | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-39543@lists.php.net to get a copy of this message | ||
Beware octal numbers in ip addresses!
Many programs standardize the length of ip addresses so that they sort well in a spreadsheet. This
can have negative consequences.
ip2long('10.0.0.1') = 167772161
long2ip(167772161) = '10.0.0.1'
ip2long('010.000.000.001') = 134217729
long2ip(134217729) = '8.0.0.1'
Is this a bug or a feature?
--
http://www.php.net/manual/en/function.ip2long.php
http://master.php.net/manage/user-notes.php?action=edit+26877
http://master.php.net/manage/user-notes.php?action=delete+26877
http://master.php.net/manage/user-notes.php?action=reject+26877