XML 内容自动翻译成我的语言php
XML content translates automatic to my language in php
我要处理的文本会自动翻译成荷兰语。
这是 xml 的一部分:
仔细看:"Event status: confirmed"
<br>Event Status: confirmed</summary><content type='html'>When: Wed Aug 26, 2015<br />
所以我基本上做的是获取 php 中的对象并打印该对象。
问题是文本现在是荷兰语。
我不知道为什么。见下图。
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();有人知道我怎样才能得到英文输出吗?
尝试在您的 URL 请求中添加 ?hl=en
,从而迫使 API 将其 return 变成您想要的语言。
我要处理的文本会自动翻译成荷兰语。 这是 xml 的一部分: 仔细看:"Event status: confirmed"
<br>Event Status: confirmed</summary><content type='html'>When: Wed Aug 26, 2015<br />
所以我基本上做的是获取 php 中的对象并打印该对象。 问题是文本现在是荷兰语。 我不知道为什么。见下图。
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();有人知道我怎样才能得到英文输出吗?
尝试在您的 URL 请求中添加 ?hl=en
,从而迫使 API 将其 return 变成您想要的语言。