Skip to Content.
Sympa Menu

discuss - Re: [opennic-discuss] The website

discuss AT lists.opennicproject.org

Subject: Discuss mailing list

List archive

Re: [opennic-discuss] The website


Chronological Thread 
  • From: Peter Green <peter AT greenpete.free>
  • To: discuss AT lists.opennicproject.org
  • Subject: Re: [opennic-discuss] The website
  • Date: Fri, 07 Dec 2012 21:30:00 +0000

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi,

I have the code working, thanks, but it's giving a lot of results. How can I
limit it to just two please?

Thanks, Peter

>the pertinent code:
>
> $ch = curl_init();
>curl_setopt($ch, CURLOPT_URL,
>"http://sourpuss.net/opennic.oss/geoip/geotxt3.php?ip=$ip".$res);
> ob_start();
> curl_exec($ch);
> $res = ob_get_contents();
> curl_close($ch);
> ob_end_clean();
> $results = array_filter(preg_split("/\s+/ ", $res));
>
> $brk = '';
> if($noformat == 0)
> {
> print "<br/>\n";
>print "Closest Tier 2 servers to your location (ordered from nearest to
>farthest):<br/>\n";
> $brk = "<br/>";
> }
>
> foreach($results as $server)
> {
> print $server.$brk."\n";
> }
>
> --Brian

- --
Wanged from my Kaiser by a mischievous pixie!
-----BEGIN PGP SIGNATURE-----
Version: APG v1.0.8

iQFBBAEBCAArBQJQwl/XJBxQZXRlciBHcmVlbiA8cGV0ZXJAZ3JlZW5wZXRlLmNv
LnVrPgAKCRDwSqngs+9nORgCB/9Lv1+9XzPi0tysgHqrFmPEhbyB0i6lrfkNcUmG
hkNBjki64aITv6oF9+JNBoaB9+RBSP6EHWs311JEm/qszLgtiThdl999Qn6kNad0
iqP4xrA5wOeXIoBn4ykiHJO/vAHREPKxY2xhg2eRnpCi8b7ahivndnsuP03nQkEA
TODhma0FZy5s3NeCpMSnBRwmpYAdndHdShIJ2yCto+mhxjp7H0gjAzqsvcA6ydMJ
SEE6rK/Azkxh61C815cmf0C8aLUCWe7McNLquSyaoRmgFK9PesDz9IIvDHa234j5
Np/Q2P0cIoly2KkSmqdakcaOxPeW/K0BjP4KH4XDJWyiVOlP
=OsBs
-----END PGP SIGNATURE-----




Archive powered by MHonArc 2.6.19.

Top of Page