note 26877 rejected from function.ip2long by victor
| From: | victor@php.net | Date: | Fri, 15 Nov 2002 19:13:55 +0000 |
| Subject: | note 26877 rejected from function.ip2long by victor | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-39551@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?