note 81012 deleted from function.ip2long by cmb
| From: | cmb@php.net | Date: | Sun, 13 Oct 2019 07:49:53 +0000 |
| Subject: | note 81012 deleted from function.ip2long by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-212609@lists.php.net to get a copy of this message | ||
Note Submitter: curda2 at hotmail dot com - Dim Works dot org
----
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
?>