ฟังก์ชัน timezone_abbreviations_list() จะคืนค่า associative array ที่มี dst, offset และชื่อเขตเวลา
ไวยากรณ์
timezone_abbreviations_list()
พารามิเตอร์
-
ไม่มี
คืนสินค้า
ฟังก์ชัน timezone_abbreviations_list() จะคืนค่าอาร์เรย์เมื่อสำเร็จ หรือ FALSE เมื่อล้มเหลว
ตัวอย่าง
ต่อไปนี้เป็นตัวอย่าง −
<?php $timezone_abbreviations = timezone_abbreviations_list (); print_r($timezone_abbreviations["acst"]); echo "----------------------------------------------\n"; # Using second function. $timezone_abbreviations = DateTimeZone::listAbbreviations(); print_r($timezone_abbreviations["acst"]); ?>
ผลลัพธ์
Array ( [0] => Array ( [dst] => 1 [offset] => -14400 [timezone_id] => America/Porto_Acre ) [1] => Array ( [dst] => [offset] => 32400 [timezone_id] => Australia/Adelaide ) [2] => Array ( [dst] => [offset] => 34200 [timezone_id] => Australia/Adelaide ) [3] => Array ( [dst] => 1 [offset] => -14400 [timezone_id] => America/Eirunepe ) [4] => Array ( [dst] => 1 [offset] => -14400 [timezone_id] => America/Rio_Branco ) [5] => Array ( [dst] => 1 [offset] => -14400 [timezone_id] => Brazil/Acre ) [6] => Array ( [dst] => [offset] => 32400 [timezone_id] => Australia/Broken_Hill ) [7] => Array ( [dst] => [offset] => 32400 [timezone_id] => Australia/Darwin ) [8] => Array ( [dst] => [offset] => 32400 [timezone_id] => Australia/North ) [9] => Array ( [dst] => [offset] => 32400 [timezone_id] => Australia/South ) [10] => Array ( [dst] => [offset] => 32400 [timezone_id] => Australia/Yancowinna ) [11] => Array ( [dst] => [offset] => 34200 [timezone_id] => Asia/Jayapura ) [12] => Array ( [dst] => [offset] => 34200 [timezone_id] => Australia/Broken_Hill ) [13] => Array ( [dst] => [offset] => 34200 [timezone_id] => Australia/Darwin ) [14] => Array ( [dst] => [offset] => 34200 [timezone_id] => Australia/North ) [15] => Array( [dst] => [offset] => 34200 [timezone_id] => Australia/South ) [16] => Array ( [dst] => [offset] => 34200 [timezone_id] => Australia/Yancowinna ) ) ---------------------------------------------- Array ( [0] => Array ( [dst] => 1 [offset] => -14400 [timezone_id] => America/Porto_Acre ) [1] => Array ( [dst] => [offset] => 32400 [timezone_id] => Australia/Adelaide ) [2] => Array ( [dst] => [offset] => 34200 [timezone_id] => Australia/Adelaide ) [3] => Array ( [dst] => 1 [offset] => -14400 [timezone_id] => America/Eirunepe ) [4] => Array ( [dst] => 1 [offset] => -14400 [timezone_id] => America/Rio_Branco ) [5] => Array ( [dst] => 1 [offset] => -14400 [timezone_id] => Brazil/Acre ) [6] => Array ( [dst] => [offset] => 32400 [timezone_id] => Australia/Broken_Hill ) [7] => Array ( [dst] => [offset] => 32400 [timezone_id] => Australia/Darwin ) [8] => Array ( [dst] => [offset] => 32400 [timezone_id] => Australia/North ) [9] => Array ( [dst] => [offset] => 32400 [timezone_id] => Australia/South ) [10] => Array ( [dst] => [offset] => 32400 [timezone_id] => Australia/Yancowinna ) [11] => Array ( [dst] => [offset] => 34200 [timezone_id] => Asia/Jayapura ) [12] => Array ( [dst] => [offset] => 34200 [timezone_id] => Australia/Broken_Hill ) [13] => Array ( [dst] => [offset] => 34200 [timezone_id] => Australia/Darwin ) [14] => Array ( [dst] => [offset] => 34200 [timezone_id] => Australia/North ) [15] => Array ( [dst] => [offset] => 34200 [timezone_id] => Australia/South ) [16] => Array ( [dst] => [offset] => 34200 [timezone_id] => Australia/Yancowinna ) )
เรามาดูตัวอย่างกัน −
ตัวอย่าง
<?php $res = timezone_abbreviations_list(); print_r($res["act"]); ?>
ผลลัพธ์
Array ( [0] => Array ( [dst] => [offset] => -18000 [timezone_id] => America/Porto_Acre ) [1] => Array ( [dst] => [offset] => -18000 [timezone_id] => America/Eirunepe ) [2] => Array ( [dst] => [offset] => -18000 [timezone_id] => America/Rio_Branco ) [3] => Array ( [dst] => [offset] => -18000 [timezone_id] => Brazil/Acre ) )