Created
September 1, 2018 15:13
-
-
Save leonardopinho/2a392636954f0a4280b84556d8f7330d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* getIpInfo | |
* @param null $ip | |
* @return mixed | |
*/ | |
public static function getIpInfo($ip = null) | |
{ | |
if (!empty($ip) && !is_null($ip)) { | |
$details = json_decode(file_get_contents("http://ipinfo.io/{$ip}/json")); | |
return $details; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment