Instalation
{
"require" : {
"wallacemaxters/ipinfo" : "1.*"
}
}
use WallaceMaxters\IPInfo\IPInfo;
Get the response of ipinfo.io.
This returns the \WallaceMaxters\IPInfo\Response
object;
$responseObject = IPInfo::get('8.8.8.8');
Get a collection of a response of \WallaceMaxters\IPInfo\Response
$ipCollection = IPInfo::get(['8.8.8.8', '7.7.7.7']);
Get Lat and Lng separated in array. This results are converted in float
list($lat, $lng) = IPInfo::get('8.8.8.8')->getLoc();
Converting information to array
IPInfo::get('8.8.8.8')->toArray();
Retrieves information from host(s)
$data = IPInfo::getFromHost('www.google.com');