使用 php 获取 json
我需要从中获取 json 数据,http://vortaro.us.to/ajax/epo/eng/ + 'word'+ “/?callback=?” 工作示例(没有足够的信誉)
我知道如何在javascript中做到这一点,但是我需要我的php文件来获取这些数据,它需要是服务器端,感谢我是新手,我花了一整天的时间试图弄清楚这一点。fopen和fread不起作用,
<?php
$vorto = $_GET['vorto']; // Get the Word from Outer Space and Search for it!
if (isset($vorto))
{
echo $vorto;
} else {
$Help = "No Vorto -> add ?vorto=TheWordYouWant to the end of this website";
echo $Help;
}
$url1 = "http://vortaro.us.to/ajax/epo/eng/";
$url2 = "/?callback=?";
$finalurl= $url1 . $vorto . $url2;
/*
PLEASE HELP
$v1 = fopen($finalurl ,"r");
echo $v1;
$frv1 = fread($v1,filesize($v1));
echo $frv1 ;
*/
?>