Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

how to get current location in laravel

$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);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #current #location #laravel
ADD COMMENT
Topic
Name
2+3 =