私はPHPを初めて使用するため、HTTPリクエストを使用してサーバーの外部にあるURLをダウンロードする必要があります。そのURLは、デコードしたJSONコードを返すPHP関数です。助言がありますか?
私は基本的なコードを試しました:
<?php
//Code for forming the url (which I'm sure is correct)
$url = ...
$response = fopen($url,"x+");
$response = json_decode($response);
echo $response;
?>
//javascript in a seperate file that calls the php code
var response = xmlhttp.responseText;
alert(response);