|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-03-12 08:58 UTC] sander@php.net
[2002-03-12 09:04 UTC] lee at nerds dot org dot uk
[2002-03-12 10:41 UTC] lee at nerds dot org dot uk
[2002-03-13 14:38 UTC] sander@php.net
[2002-03-13 15:25 UTC] lee at nerds dot org dot uk
[2002-03-19 07:02 UTC] lee at nerds dot org dot uk
[2002-07-07 20:54 UTC] sniper@php.net
[2002-08-10 01:00 UTC] php-bugs at lists dot php dot net
[2002-08-15 23:21 UTC] nohn@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 11:00:01 2025 UTC |
I have found some problems where long2ip (and I would presume ip2long by the same token) seems to return an IP address offset by one. I'm not sure if it is the implmentation of inet_ntoa on the platform I am using or something else. Even if this is a problem with a particular version of a library on my machine, maybe it might be worth using a method other than inet_ntoa for ease of platform independance? Perhaps something along there lines.... ? struct inet4addr { unsigned int a:8; unsigned int b:8; unsigned int c:8; unsigned int d:8; }; typedef union { unsigned int inet4dec; struct inet4addr inet4oct; } inet4oct; blah.inet4dec = <SOME LONG IP HERE>; printf("%i.%i.%i.%i\n", blah.inet4oct.a, blah.inet4oct.b,blah.inet4oct.c,blah.inet4oct.d);