Skip to content

Instantly share code, notes, and snippets.

@timersys
Last active August 12, 2022 14:21
Show Gist options
  • Save timersys/b6dda85acb7ca19c67d24700977cf0f0 to your computer and use it in GitHub Desktop.
Save timersys/b6dda85acb7ca19c67d24700977cf0f0 to your computer and use it in GitHub Desktop.

Revisions

  1. timersys revised this gist Aug 12, 2022. 1 changed file with 0 additions and 6 deletions.
    6 changes: 0 additions & 6 deletions functions.php
    Original file line number Diff line number Diff line change
    @@ -47,12 +47,6 @@

    echo 'Your time zone is: '. geot_time_zone();

    //geot_radius
    // Return current user radius

    echo 'The accuracy radius is: '. geot_accuracy_radius();


    //geot_lat
    // Return current user lat

  2. timersys created this gist Jan 19, 2021.
    65 changes: 65 additions & 0 deletions functions.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,65 @@
    <?php
    // geot_user_country
    // Return object of current user country details
    $country = geot_user_country();

    echo $country->name;
    echo $country->isoCode;

    //geot_country_code
    // return current user country code

    echo 'You country code is : ' . geot_country_code();


    //geot_country_name
    // return current user country name

    echo 'You country name is : ' . geot_country_name();

    //geot_country_by_ip
    // Return country by given ip or current user if not ip is given
    // $country->name $country->isoCode
    $country = geot_country_by_ip("190.188.153.122");

    echo 'Your country is : '. $country->name;


    //geot_state_by_ip
    // Return state by given ip or current user if not ip is given
    // $state->name $state->isoCode
    $state = geot_state_by_ip("190.188.153.122");

    echo 'Your state is : '. $state->name;

    //geot_city_name
    // Return current user city name
    echo 'Your city is: '. geot_city_name();


    //geot_zip
    // Return current user zip code

    echo 'Your zip is: '. geot_zip();

    //geot_time_zone
    // Return current user time zone

    echo 'Your time zone is: '. geot_time_zone();

    //geot_radius
    // Return current user radius

    echo 'The accuracy radius is: '. geot_accuracy_radius();


    //geot_lat
    // Return current user lat

    echo 'Your latitude is: '. geot_lat();


    //geot_lng
    // Return current user lng

    echo 'Your longitude is: '. geot_lng();