note 51218 added to function.inet-ntop
| From: | mirko dot steiner at slashdevslashnull dot de | Date: | Wed, 23 Mar 2005 19:08:00 +0000 |
| Subject: | note 51218 added to function.inet-ntop | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-86856@lists.php.net to get a copy of this message | ||
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...
----
Manual Page -- http://www.php.net/manual/en/function.inet-ntop.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+51218
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+51218&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+51218&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+51218&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+51218&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+51218&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+51218&report=yes
Search -- http://master.php.net/manage/user-notes.php