note 81012 added to function.ip2long
| From: | curda2 at hotmail dot com-DimWorks dot org | Date: | Mon, 11 Feb 2008 07:01:57 +0000 |
| Subject: | note 81012 added to function.ip2long | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-136022@lists.php.net to get a copy of this message | ||
The things that this function do is:
Structure of function:
<?php
$ip = getenv(REMOTE_ADDR);
$numbers=explode (".",$ip);
$code=($numbers[0] * 16777216) + ($numbers[1] * 65536) + ($numbers[2] * 256) + ($numbers[3]);
//$code is the final variant
?>
that is similar to do this:
<?php
$ip = getenv(REMOTE_ADDR);
$code=ip2long($ip);
//$code is the final variant
?>
----
Server IP: 69.147.83.197
Probable Submitter: 189.194.203.5
----
Manual Page -- http://www.php.net/manual/en/function.ip2long.php
Edit -- https://master.php.net/note/edit/81012
Del: integrated -- https://master.php.net/note/delete/81012/integrated
Del: useless -- https://master.php.net/note/delete/81012/useless
Del: bad code -- https://master.php.net/note/delete/81012/bad+code
Del: spam -- https://master.php.net/note/delete/81012/spam
Del: non-english -- https://master.php.net/note/delete/81012/non-english
Del: in docs -- https://master.php.net/note/delete/81012/in+docs
Del: other reasons-- https://master.php.net/note/delete/81012
Reject -- https://master.php.net/note/reject/81012
Search -- https://master.php.net/manage/user-notes.php