我正在制作一个需要显示视频的html页面.视频的网址在jsondecode输出中找到.有没有办法从该JSON输出中选择片段并在我的html页面中使用它?我已经尝试过POST和GET和echo,但似乎没有用.
要明确:我正试图从php文件到单独的HTML文件.
该JSON反应是在功能的单独的文件中.
public function getURL(){
$server_url= ilObjPresentations2GoGUI::getServerUrl();
$secret_key= ilObjPresentations2GoGUI::getSecretKey();
$authorized_group= ilObjPresentations2GoGUI::getAuthorizedGroup();
$link_usable= ilObjPresentations2GoGUI::getLinkUsable();
$query = 'technology';
$date = new DateTime('NOW');
$ts = $date->format('Y-m-d\TH:i:s');
$interval = 'PT' . $this->link_usable . 'H';
$date->add(new DateInterval('PT' . $link_usable . 'H'));
$expired = $date->format('Y-m-d\TH:i:s');
$url = $server_url . '?action=search&query='. $query . '&group='. $authorized_group . '&ts=' . $ts . '&expired=' .$expired;
$token = ilObjPresentations2GoAPI::create($url,$secret_key);
$goodurl = $url . '&token=' . $token;
$json = file_get_contents($goodurl);
$the_data = json_decode($json, true);}
Run Code Online (Sandbox Code Playgroud)
输出: …