note 39142 added to function.ip2long
| From: | sunfire at freemail dot hu | Date: | Sun, 18 Jan 2004 16:31:05 +0000 |
| Subject: | note 39142 added to function.ip2long | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-63792@lists.php.net to get a copy of this message | ||
The original function was writen by J.Adams <jna@retina.net> see this page. I found a mistake
his code, and make it a little simpler.
function testip($range,$ip) {
.....
$maskl = 0;
for ($i = 0; $i < $regs[5]-1; $i++) {
$maskl += pow(2,(31-$i));
}
if (($maskl & $rangel) == ($maskl & $ipl)) {
.....
}
----
Manual Page -- http://www.php.net/manual/en/function.ip2long.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+39142
Delete -- http://master.php.net/manage/user-notes.php?action=delete+39142&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+39142&report=yes
Search -- http://master.php.net/manage/user-notes.php