📜  如何在 laravel 中获取当前位置 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:35.640000             🧑  作者: Mango

代码示例1
$country=file_get_contents('http://api.hostip.info/get_html.php?ip=');
echo $country;

// Reformat the data returned (Keep only country and country abbr.)
$only_country=explode (" ", $country);

echo "Country : ".$only_country[1]." ".substr($only_country[2],0,4);