Rumah > pembangunan bahagian belakang > tutorial php > php自定义数组变量存放全球各个时区信息

php自定义数组变量存放全球各个时区信息

墨辰丷
Lepaskan: 2023-03-31 16:30:01
asal
1951 orang telah melayarinya

这篇文章主要介绍了php输出全球各个时区列表的方法,自定义了一个数组变量用于存放全球各个时区信息,具有一定参考借鉴价值,需要的朋友可以参考下

本文实例讲述了php输出全球各个时区列表的方法。具体实现方法如下:

<?php
$timezones =
array (
 &#39;(GMT-12:00) International Date Line West&#39; => &#39;Pacific/Wake&#39;,
 &#39;(GMT-11:00) Midway Island&#39; => &#39;Pacific/Apia&#39;,
 &#39;(GMT-11:00) Samoa&#39; => &#39;Pacific/Apia&#39;,
 &#39;(GMT-10:00) Hawaii&#39; => &#39;Pacific/Honolulu&#39;,
 &#39;(GMT-09:00) Alaska&#39; => &#39;America/Anchorage&#39;,
 &#39;(GMT-08:00) Pacific Time (US & Canada); Tijuana&#39; => &#39;America/Los_Angeles&#39;,
 &#39;(GMT-07:00) Arizona&#39; => &#39;America/Phoenix&#39;,
 &#39;(GMT-07:00) Chihuahua&#39; => &#39;America/Chihuahua&#39;,
 &#39;(GMT-07:00) La Paz&#39; => &#39;America/Chihuahua&#39;,
 &#39;(GMT-07:00) Mazatlan&#39; => &#39;America/Chihuahua&#39;,
 &#39;(GMT-07:00) Mountain Time (US & Canada)&#39; => &#39;America/Denver&#39;,
 &#39;(GMT-06:00) Central America&#39; => &#39;America/Managua&#39;,
 &#39;(GMT-06:00) Central Time (US & Canada)&#39; => &#39;America/Chicago&#39;,
 &#39;(GMT-06:00) Guadalajara&#39; => &#39;America/Mexico_City&#39;,
 &#39;(GMT-06:00) Mexico City&#39; => &#39;America/Mexico_City&#39;,
 &#39;(GMT-06:00) Monterrey&#39; => &#39;America/Mexico_City&#39;,
 &#39;(GMT-06:00) Saskatchewan&#39; => &#39;America/Regina&#39;,
 &#39;(GMT-05:00) Bogota&#39; => &#39;America/Bogota&#39;,
 &#39;(GMT-05:00) Eastern Time (US & Canada)&#39; => &#39;America/New_York&#39;,
 &#39;(GMT-05:00) Indiana (East)&#39; => &#39;America/Indiana/Indianapolis&#39;,
 &#39;(GMT-05:00) Lima&#39; => &#39;America/Bogota&#39;,
 &#39;(GMT-05:00) Quito&#39; => &#39;America/Bogota&#39;,
 &#39;(GMT-04:00) Atlantic Time (Canada)&#39; => &#39;America/Halifax&#39;,
 &#39;(GMT-04:00) Caracas&#39; => &#39;America/Caracas&#39;,
 &#39;(GMT-04:00) La Paz&#39; => &#39;America/Caracas&#39;,
 &#39;(GMT-04:00) Santiago&#39; => &#39;America/Santiago&#39;,
 &#39;(GMT-03:30) Newfoundland&#39; => &#39;America/St_Johns&#39;,
 &#39;(GMT-03:00) Brasilia&#39; => &#39;America/Sao_Paulo&#39;,
 &#39;(GMT-03:00) Buenos Aires&#39; => &#39;America/Argentina/Buenos_Aires&#39;,
 &#39;(GMT-03:00) Georgetown&#39; => &#39;America/Argentina/Buenos_Aires&#39;,
 &#39;(GMT-03:00) Greenland&#39; => &#39;America/Godthab&#39;,
 &#39;(GMT-02:00) Mid-Atlantic&#39; => &#39;America/Noronha&#39;,
 &#39;(GMT-01:00) Azores&#39; => &#39;Atlantic/Azores&#39;,
 &#39;(GMT-01:00) Cape Verde Is.&#39; => &#39;Atlantic/Cape_Verde&#39;,
 &#39;(GMT) Casablanca&#39; => &#39;Africa/Casablanca&#39;,
 &#39;(GMT) Edinburgh&#39; => &#39;Europe/London&#39;,
 &#39;(GMT) Greenwich Mean Time : Dublin&#39; => &#39;Europe/London&#39;,
 &#39;(GMT) Lisbon&#39; => &#39;Europe/London&#39;,
 &#39;(GMT) London&#39; => &#39;Europe/London&#39;,
 &#39;(GMT) Monrovia&#39; => &#39;Africa/Casablanca&#39;,
 &#39;(GMT+01:00) Amsterdam&#39; => &#39;Europe/Berlin&#39;,
 &#39;(GMT+01:00) Belgrade&#39; => &#39;Europe/Belgrade&#39;,
 &#39;(GMT+01:00) Berlin&#39; => &#39;Europe/Berlin&#39;,
 &#39;(GMT+01:00) Bern&#39; => &#39;Europe/Berlin&#39;,
 &#39;(GMT+01:00) Bratislava&#39; => &#39;Europe/Belgrade&#39;,
 &#39;(GMT+01:00) Brussels&#39; => &#39;Europe/Paris&#39;,
 &#39;(GMT+01:00) Budapest&#39; => &#39;Europe/Belgrade&#39;,
 &#39;(GMT+01:00) Copenhagen&#39; => &#39;Europe/Paris&#39;,
 &#39;(GMT+01:00) Ljubljana&#39; => &#39;Europe/Belgrade&#39;,
 &#39;(GMT+01:00) Madrid&#39; => &#39;Europe/Paris&#39;,
 &#39;(GMT+01:00) Paris&#39; => &#39;Europe/Paris&#39;,
 &#39;(GMT+01:00) Prague&#39; => &#39;Europe/Belgrade&#39;,
 &#39;(GMT+01:00) Rome&#39; => &#39;Europe/Berlin&#39;,
 &#39;(GMT+01:00) Sarajevo&#39; => &#39;Europe/Sarajevo&#39;,
 &#39;(GMT+01:00) Skopje&#39; => &#39;Europe/Sarajevo&#39;,
 &#39;(GMT+01:00) Stockholm&#39; => &#39;Europe/Berlin&#39;,
 &#39;(GMT+01:00) Vienna&#39; => &#39;Europe/Berlin&#39;,
 &#39;(GMT+01:00) Warsaw&#39; => &#39;Europe/Sarajevo&#39;,
 &#39;(GMT+01:00) West Central Africa&#39; => &#39;Africa/Lagos&#39;,
 &#39;(GMT+01:00) Zagreb&#39; => &#39;Europe/Sarajevo&#39;,
 &#39;(GMT+02:00) Athens&#39; => &#39;Europe/Istanbul&#39;,
 &#39;(GMT+02:00) Bucharest&#39; => &#39;Europe/Bucharest&#39;,
 &#39;(GMT+02:00) Cairo&#39; => &#39;Africa/Cairo&#39;,
 &#39;(GMT+02:00) Harare&#39; => &#39;Africa/Johannesburg&#39;,
 &#39;(GMT+02:00) Helsinki&#39; => &#39;Europe/Helsinki&#39;,
 &#39;(GMT+02:00) Istanbul&#39; => &#39;Europe/Istanbul&#39;,
 &#39;(GMT+02:00) Jerusalem&#39; => &#39;Asia/Jerusalem&#39;,
 &#39;(GMT+02:00) Kyiv&#39; => &#39;Europe/Helsinki&#39;,
 &#39;(GMT+02:00) Minsk&#39; => &#39;Europe/Istanbul&#39;,
 &#39;(GMT+02:00) Pretoria&#39; => &#39;Africa/Johannesburg&#39;,
 &#39;(GMT+02:00) Riga&#39; => &#39;Europe/Helsinki&#39;,
 &#39;(GMT+02:00) Sofia&#39; => &#39;Europe/Helsinki&#39;,
 &#39;(GMT+02:00) Tallinn&#39; => &#39;Europe/Helsinki&#39;,
 &#39;(GMT+02:00) Vilnius&#39; => &#39;Europe/Helsinki&#39;,
 &#39;(GMT+03:00) Baghdad&#39; => &#39;Asia/Baghdad&#39;,
 &#39;(GMT+03:00) Kuwait&#39; => &#39;Asia/Riyadh&#39;,
 &#39;(GMT+03:00) Moscow&#39; => &#39;Europe/Moscow&#39;,
 &#39;(GMT+03:00) Nairobi&#39; => &#39;Africa/Nairobi&#39;,
 &#39;(GMT+03:00) Riyadh&#39; => &#39;Asia/Riyadh&#39;,
 &#39;(GMT+03:00) St. Petersburg&#39; => &#39;Europe/Moscow&#39;,
 &#39;(GMT+03:00) Volgograd&#39; => &#39;Europe/Moscow&#39;,
 &#39;(GMT+03:30) Tehran&#39; => &#39;Asia/Tehran&#39;,
 &#39;(GMT+04:00) Abu Dhabi&#39; => &#39;Asia/Muscat&#39;,
 &#39;(GMT+04:00) Baku&#39; => &#39;Asia/Tbilisi&#39;,
 &#39;(GMT+04:00) Muscat&#39; => &#39;Asia/Muscat&#39;,
 &#39;(GMT+04:00) Tbilisi&#39; => &#39;Asia/Tbilisi&#39;,
 &#39;(GMT+04:00) Yerevan&#39; => &#39;Asia/Tbilisi&#39;,
 &#39;(GMT+04:30) Kabul&#39; => &#39;Asia/Kabul&#39;,
 &#39;(GMT+05:00) Ekaterinburg&#39; => &#39;Asia/Yekaterinburg&#39;,
 &#39;(GMT+05:00) Islamabad&#39; => &#39;Asia/Karachi&#39;,
 &#39;(GMT+05:00) Karachi&#39; => &#39;Asia/Karachi&#39;,
 &#39;(GMT+05:00) Tashkent&#39; => &#39;Asia/Karachi&#39;,
 &#39;(GMT+05:30) Chennai&#39; => &#39;Asia/Calcutta&#39;,
 &#39;(GMT+05:30) Kolkata&#39; => &#39;Asia/Calcutta&#39;,
 &#39;(GMT+05:30) Mumbai&#39; => &#39;Asia/Calcutta&#39;,
 &#39;(GMT+05:30) New Delhi&#39; => &#39;Asia/Calcutta&#39;,
 &#39;(GMT+05:45) Kathmandu&#39; => &#39;Asia/Katmandu&#39;,
 &#39;(GMT+06:00) Almaty&#39; => &#39;Asia/Novosibirsk&#39;,
 &#39;(GMT+06:00) Astana&#39; => &#39;Asia/Dhaka&#39;,
 &#39;(GMT+06:00) Dhaka&#39; => &#39;Asia/Dhaka&#39;,
 &#39;(GMT+06:00) Novosibirsk&#39; => &#39;Asia/Novosibirsk&#39;,
 &#39;(GMT+06:00) Sri Jayawardenepura&#39; => &#39;Asia/Colombo&#39;,
 &#39;(GMT+06:30) Rangoon&#39; => &#39;Asia/Rangoon&#39;,
 &#39;(GMT+07:00) Bangkok&#39; => &#39;Asia/Bangkok&#39;,
 &#39;(GMT+07:00) Hanoi&#39; => &#39;Asia/Bangkok&#39;,
 &#39;(GMT+07:00) Jakarta&#39; => &#39;Asia/Bangkok&#39;,
 &#39;(GMT+07:00) Krasnoyarsk&#39; => &#39;Asia/Krasnoyarsk&#39;,
 &#39;(GMT+08:00) Beijing&#39; => &#39;Asia/Hong_Kong&#39;,
 &#39;(GMT+08:00) Chongqing&#39; => &#39;Asia/Hong_Kong&#39;,
 &#39;(GMT+08:00) Hong Kong&#39; => &#39;Asia/Hong_Kong&#39;,
 &#39;(GMT+08:00) Irkutsk&#39; => &#39;Asia/Irkutsk&#39;,
 &#39;(GMT+08:00) Kuala Lumpur&#39; => &#39;Asia/Singapore&#39;,
 &#39;(GMT+08:00) Perth&#39; => &#39;Australia/Perth&#39;,
 &#39;(GMT+08:00) Singapore&#39; => &#39;Asia/Singapore&#39;,
 &#39;(GMT+08:00) Taipei&#39; => &#39;Asia/Taipei&#39;,
 &#39;(GMT+08:00) Ulaan Bataar&#39; => &#39;Asia/Irkutsk&#39;,
 &#39;(GMT+08:00) Urumqi&#39; => &#39;Asia/Hong_Kong&#39;,
 &#39;(GMT+09:00) Osaka&#39; => &#39;Asia/Tokyo&#39;,
 &#39;(GMT+09:00) Sapporo&#39; => &#39;Asia/Tokyo&#39;,
 &#39;(GMT+09:00) Seoul&#39; => &#39;Asia/Seoul&#39;,
 &#39;(GMT+09:00) Tokyo&#39; => &#39;Asia/Tokyo&#39;,
 &#39;(GMT+09:00) Yakutsk&#39; => &#39;Asia/Yakutsk&#39;,
 &#39;(GMT+09:30) Adelaide&#39; => &#39;Australia/Adelaide&#39;,
 &#39;(GMT+09:30) Darwin&#39; => &#39;Australia/Darwin&#39;,
 &#39;(GMT+10:00) Brisbane&#39; => &#39;Australia/Brisbane&#39;,
 &#39;(GMT+10:00) Canberra&#39; => &#39;Australia/Sydney&#39;,
 &#39;(GMT+10:00) Guam&#39; => &#39;Pacific/Guam&#39;,
 &#39;(GMT+10:00) Hobart&#39; => &#39;Australia/Hobart&#39;,
 &#39;(GMT+10:00) Melbourne&#39; => &#39;Australia/Sydney&#39;,
 &#39;(GMT+10:00) Port Moresby&#39; => &#39;Pacific/Guam&#39;,
 &#39;(GMT+10:00) Sydney&#39; => &#39;Australia/Sydney&#39;,
 &#39;(GMT+10:00) Vlapostok&#39; => &#39;Asia/Vlapostok&#39;,
 &#39;(GMT+11:00) Magadan&#39; => &#39;Asia/Magadan&#39;,
 &#39;(GMT+11:00) New Caledonia&#39; => &#39;Asia/Magadan&#39;,
 &#39;(GMT+11:00) Solomon Is.&#39; => &#39;Asia/Magadan&#39;,
 &#39;(GMT+12:00) Auckland&#39; => &#39;Pacific/Auckland&#39;,
 &#39;(GMT+12:00) Fiji&#39; => &#39;Pacific/Fiji&#39;,
 &#39;(GMT+12:00) Kamchatka&#39; => &#39;Pacific/Fiji&#39;,
 &#39;(GMT+12:00) Marshall Is.&#39; => &#39;Pacific/Fiji&#39;,
 &#39;(GMT+12:00) Wellington&#39; => &#39;Pacific/Auckland&#39;,
 &#39;(GMT+13:00) Nuku\&#39;alofa&#39; => &#39;Pacific/Tongatapu&#39;,
);
print_r($timezones);
?>
Salin selepas log masuk

总结:以上就是本篇文的全部内容,希望能对大家的学习有所帮助。

相关推荐:

php模板与js上传插件结合实现无刷新上传的方法

php采用链式调用的方式连续调用函数的使用方法

php数字及数字运算验证码

Atas ialah kandungan terperinci php自定义数组变量存放全球各个时区信息. Untuk maklumat lanjut, sila ikut artikel berkaitan lain di laman web China PHP!

Label berkaitan:
sumber:php.cn
Kenyataan Laman Web ini
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn
Artikel terbaru oleh pengarang
Tutorial Popular
Lagi>
Muat turun terkini
Lagi>
kesan web
Kod sumber laman web
Bahan laman web
Templat hujung hadapan