我无法使用 php json 解码显示来自这个 url 的数据:https : //api.mymemory.translated.net/get? q = Hello%20World! & langpair = en|it
这是数据提供者:https : //mymemory.translated.net/doc/spec.php
谢谢。
我想要的是设置一个表单来提交单词并从他们的 API 中获取翻译。
这是我的代码示例:
<?php
$json = file_get_contents('https://api.mymemory.translated.net/get?q=Hello%20World!&langpair=en|it');
// parse the JSON
$data = json_decode($json);
// show the translation
echo $data;
?>
慕尼黑的夜晚无繁华
陪伴而非守候