note 51218 deleted from function.inet-ntop by googleguy
| From: | googleguy@php.net | Date: | Tue, 22 Oct 2013 10:17:04 +0000 |
| Subject: | note 51218 deleted from function.inet-ntop by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-196973@lists.php.net to get a copy of this message | ||
Note Submitter: mirko dot steiner at slashdevslashnull dot de
----
i've used this nice one oneline code:
<?PHP
$one = 192;
$two = 168;
$three = 1;
$four = 1;
$ip = $one*pow(256,3) + $two*pow(256,2) + $three*pow(256,1) + $four*pow(256,0);
echo $ip;
?>
you can also put the first one, shift them by 24 bits to the right, take the secod and shift them by
16, the 3rd by 8 and put thouse all together bitwise...