Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
// geot_user_country
// Return object of current user country details
$country = geot_user_country();
echo $country->name;
echo $country->isoCode;
// return current user country code
echo 'You country code is : ' . geot_country_code();
// return current user country name
echo 'You country name is : ' . geot_country_name();
// Return country by given ip or current user if not ip is given
// $country->name $country->isoCode
$country = geot_country_by_ip("");
echo 'Your country is : '. $country->name;
// Return state by given ip or current user if not ip is given
// $state->name $state->isoCode
$state = geot_state_by_ip("");
echo 'Your state is : '. $state->name;
// Return current user city name
echo 'Your city is: '. geot_city_name();
// Return current user zip code
echo 'Your zip is: '. geot_zip();
// Return current user time zone
echo 'Your time zone is: '. geot_time_zone();
// Return current user radius
echo 'The accuracy radius is: '. geot_accuracy_radius();
// Return current user lat
echo 'Your latitude is: '. geot_lat();
// Return current user lng
echo 'Your longitude is: '. geot_lng();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment