gpt4 book ai didi

php - 我如何从 Zend Framework 的 Zend_Locale 中获取元区域列表?

转载 作者:搜寻专家 更新时间:2023-10-31 21:45:49 25 4
gpt4 key购买 nike

我正在尝试为 UI 组件列出所有最常见的时区。通过深入研究 Zend 框架,我发现 supplementalData.xml(由 Zend_Locale 组件使用)有一个元区域列表,其中包含首选的 TZ 数据库时区名称

    <mapTimezones type="metazones">
<mapZone other="Acre" territory="001" type="America/Rio_Branco"/>
<mapZone other="Afghanistan" territory="001" type="Asia/Kabul"/>
<mapZone other="Africa_Central" territory="001" type="Africa/Maputo"/>
<mapZone other="Africa_Central" territory="BI" type="Africa/Bujumbura"/>
<mapZone other="Africa_Central" territory="BW" type="Africa/Gaborone"/>
<mapZone other="Africa_Central" territory="CD" type="Africa/Lubumbashi"/>
(...)

我认为这很适合我的需求,我想提取此列表。我不想破解我的库版本,而是想知道是否有办法通过正常方式获取此列表(似乎没有办法,而且似乎没有在任何地方查询此元区域信息)。

谢谢!

最佳答案

我不确定你想要哪一个,但你最好的人选是

$locale->getTranslationList('TerritoryToTimezone');

其中 TerritoryToTimezone 可以与 Zend_Locale subchapter Obtaining Localized Data 的引用手册中描述的任何标识符交换.

如果这些都不能满足您的需求,您仍然可以 use DOM to parse the XML .

关于php - 我如何从 Zend Framework 的 Zend_Locale 中获取元区域列表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3870289/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com