|
Posted by jools on 01/08/08 12:25
In article <op.t4ly5xgf5bnjuv@metallium.lan>, luiheidsgoeroe@hotmail.com
says...
> Hmm, come to think of it...
> Allthough not intended for this use, version_compare() would do the tric=
> k =
>
> without any problems I think. As the behavious of version_compare is =
>
> clearly defined, and suited for (proven to be valid) IP-addresses, I'd g=
> o =
>
> with that:
> <?php
> $array =3D array(
> '122.23.45.53',
> '12.23.46.53',
> '12.23.45.54',
> '12.23.45.53',
> '12.23.'
> '12.23.45.53');
> usort($array,'version_compare');
> print_r($array);
> ?>
>
> .. unless you also need the insurance the IP adress is valid/stuff like =
> =
>
> 256 is captured/converted, in which case ip2long is still better.
I'll go take a look at that too. Cheers.
Validation isn't a problem - I use the Data Minion DSVE for all my
validations now - it makes life SO much easier! The forms tool even
writes the PHP code for you.
I'd give you the link for it but this isn't my own development machine (I
can't remember it - or google it from here sadly)
-jools-
Navigation:
[Reply to this message]
|