note 41882 added to function.ip2long

From: Date: Sat, 24 Apr 2004 16:03:11 +0000
Subject: note 41882 added to function.ip2long
Groups: php.notes 
Request: Send a blank email to php-notes+get-68735@lists.php.net to get a copy of this message
For those poor little people using PHP 3, here's an ip2long: <?php if (!function_exists("ip2long")) { function ip2long($ip) { $ex = explode(".", $ip); if (count($ex)!=4) return -1; list($a, $b, $c, $d) = $ex; $a = $a*16777216; $b = $b*65536; $c = $c*256; return $a+$b+$c+$d; } } ?> ---- Manual Page -- http://www.php.net/manual/en/function.ip2long.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+41882 Delete -- http://master.php.net/manage/user-notes.php?action=delete+41882&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+41882&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#68735) next »