search
HomeBackend DevelopmentPHP TutorialPHP custom array variables store time zone information around the world

This article mainly introduces the method of PHP outputting a list of various time zones around the world. An array variable is customized to store information about various time zones around the world. It has certain reference value. Friends who need it can refer to it

The example in this article describes how PHP outputs a list of time zones around the world. The specific implementation method is as follows:

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

Summary: The above is the entire content of this article, I hope it will be helpful to everyone's learning.

Related recommendations:

How to combine php template with js upload plug-in to achieve refresh-free upload

##php How to use chain calls to continuously call functions

php number and number operation verification code

The above is the detailed content of PHP custom array variables store time zone information around the world. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
What is the full form of PHP?What is the full form of PHP?Apr 28, 2025 pm 04:58 PM

The article discusses PHP, detailing its full form, main uses in web development, comparison with Python and Java, and its ease of learning for beginners.

How does PHP handle form data?How does PHP handle form data?Apr 28, 2025 pm 04:57 PM

PHP handles form data using $\_POST and $\_GET superglobals, with security ensured through validation, sanitization, and secure database interactions.

What is the difference between PHP and ASP.NET?What is the difference between PHP and ASP.NET?Apr 28, 2025 pm 04:56 PM

The article compares PHP and ASP.NET, focusing on their suitability for large-scale web applications, performance differences, and security features. Both are viable for large projects, but PHP is open-source and platform-independent, while ASP.NET,

Is PHP a case-sensitive language?Is PHP a case-sensitive language?Apr 28, 2025 pm 04:55 PM

PHP's case sensitivity varies: functions are insensitive, while variables and classes are sensitive. Best practices include consistent naming and using case-insensitive functions for comparisons.

How do you redirect a page in PHP?How do you redirect a page in PHP?Apr 28, 2025 pm 04:54 PM

The article discusses various methods for page redirection in PHP, focusing on the header() function and addressing common issues like "headers already sent" errors.

Explain type hinting in PHPExplain type hinting in PHPApr 28, 2025 pm 04:52 PM

Article discusses type hinting in PHP, a feature for specifying expected data types in functions. Main issue is improving code quality and readability through type enforcement.

What is PDO in PHP?What is PDO in PHP?Apr 28, 2025 pm 04:51 PM

The article discusses PHP Data Objects (PDO), an extension for database access in PHP. It highlights PDO's role in enhancing security through prepared statements and its benefits over MySQLi, including database abstraction and better error handling.

How to create API in PHP?How to create API in PHP?Apr 28, 2025 pm 04:50 PM

Article discusses creating and securing PHP APIs, detailing steps from endpoint definition to performance optimization using frameworks like Laravel and best security practices.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!