Search
 
SCRIPT & CODE EXAMPLE
 

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);
Comment

PREVIOUS NEXT
Code Example
Php :: --prefer-dist what is use in laravel 
Php :: php check if value exists in multidimensional array 
Php :: calculate 18 years back date in php 
Php :: how to use flash message in laravel 
Php :: larvel make http request 
Php :: how to limit word in php 
Php :: laravel unique multiple columns 
Php :: check variable type in php 
Php :: php cloudflare get country from IP 
Php :: php move file to another directory 
Php :: send email template via php 
Php :: php string underscore into camelcase 
Php :: php scandir 
Php :: map associative array php0 
Php :: utf8 php 
Php :: create a modal livewire laravel 
Php :: check if index exists in array php 
Php :: php link to page 
Php :: acf get field 
Php :: laravel 8: bootstrap 
Php :: How to reset phpmyadmin username and password 
Php :: string to boolean php 
Php :: laravel 6 get user id 
Php :: hello world php 
Php :: convert single quote in htmlentities php 
Php :: automatically make created_by and updated_by laravel 
Php :: array flat php 
Php :: Passing PHP Arrays to JavaScript 
Php :: laravel log path 
Php :: pagination with search query in laravel 
ADD CONTENT
Topic
Content
Source link
Name
2+7 =