note 39142 deleted from function.ip2long by danbrown

From: Date: Fri, 05 Dec 2008 13:45:48 +0000
Subject: note 39142 deleted from function.ip2long by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-147701@lists.php.net to get a copy of this message
Note Submitter: sunfire at freemail dot hu ---- 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)) { ..... }

« previous php.notes (#147701) next »