Re: Net_IPv4
| From: | Eric | Date: | Sat, 28 Jun 2003 04:11:22 +0000 |
| Subject: | Re: Net_IPv4 | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-17806@lists.php.net to get a copy of this message | ||
I can certainly add the functionality. I'm not sure what the usage of it
would be, but it's really not that hard to do. I'll have it finished in a
few minutes. If you have the data stored in the database, it's DEFINITELY
better to let the database do the work. PostgreSQL has an inet data type
that does most of the work for you. Other than that, it's best to store
the (long) network address and (long) broadcast address in the database.
Then you can query the following:
select * from mytable where ip > long_net and ip < long_bcast
Anyhow.. it'll be in CVS soon...
eric
On Fri, 27 Jun 2003, Stefan Walk wrote:
> On Fri, Jun 27, 2003 at 01:38:12PM +0200, Lukas Smith wrote:
> > are there any plans to include checking if an IP is within a given IP
> > range into this package?
> >
> > In the user comments for ip2long a user listed a function which
> > supposedly does this:
> > http://de3.php.net/manual/en/function.ip2long.php
>
> I once did that, but then reverted it because i wanted to do the
> range-checking directly in the DB. It's easy to add, if eric likes the
> idea it should be no problem.
>
> --
> Regards,
> Stefan Walk
> <swalk@prp0.prp.physik.tu-darmstadt.de>
>