XML内容在php中自动转换为我的语言

问题描述 投票:1回答:1

会发生什么事情是我想要使用的文本自动转换为荷兰语。这是xml的一部分:仔细看看:“事件状态:已确认”

&lt;br&gt;Event Status: confirmed</summary><content type='html'>When: Wed Aug 26, 2015&lt;br /&gt;

所以我基本上做的是在php中获取对象并打印对象。问题是文本现在是荷兰语。我不知道为什么。看下面的图像。

https://i.gyazo.com/c08efd3bce0aff804ea747de4d27acd9.png

if (($response_xml_data = file_get_contents($map_url))===false){
    echo "Error fetching XML\n";
} else {
   libxml_use_internal_errors(true);
   $data = simplexml_load_string($response_xml_data);
   print_r($data);

我认为它出错的地方:file_get_contents();有人知道如何获得英语输出吗?

php xml google-calendar-api
1个回答
0
投票

尝试在您的URL请求中添加?hl=en,从而强制API将其返回到您想要的语言。

© www.soinside.com 2019 - 2024. All rights reserved.