How to find timezone ID from IP address/country name in PHP?

后端 未结 4 517
北荒
北荒 2020-12-02 01:40

Can anyone please tell me if there is any way available in PHP to fetch timezone region like(\'Asia/Calcutta\') from IP Address or country name?

Description:

<
4条回答
  •  半阙折子戏
    2020-12-02 02:26

    This way you get time zone..

    ';
    print_r($data);
    echo '
    '; //Timezone echo $data['timezone']; ?> //OUTPUT Array ( [ip] => 2405:204:f089:d0e8:b1e7:a83e:9e2d:1bb5 [city] => Bhubaneswar [region] => Odisha [region_code] => OR [country] => IN [country_name] => India [continent_code] => AS [postal] => [latitude] => 20.2333 [longitude] => 85.8333 [timezone] => Asia/Kolkata [utc_offset] => +0530 [country_calling_code] => +91 [currency] => INR [languages] => en-IN,hi,bn,te,mr,ta,ur,gu,kn,ml,or,pa,as,bh,sat,ks,ne,sd,kok,doi,mni,sit,sa,fr,lus,inc [asn] => AS55836 [org] => Reliance Jio Infocomm Limited ) Asia/Kolkata

提交回复
热议问题