APIとPHPを使用しているときは、私は完全なnoobです。 books.json というファイルに次のコードのダンプ結果を残しておきたいと思います。どんな助けでも大歓迎です!ニューヨークタイムAPIからJSONファイルへの出力
// Built by LucyBot. www.lucybot.com
$curl = curl_init();
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$query = array(
"api-key" => "MY APRI KEY"
);
curl_setopt($curl, CURLOPT_URL,
"https://api.nytimes.com/svc/books/v3/lists/best-sellers/history.json" . "?" . http_build_query($query)
);
$result = json_decode(curl_exec($curl));
echo json_encode($result);
申し訳ありません。 – Fabien
すでに回答済みですhttps://stackoverflow.com/questions/1768894/how-to-write-into-a-file-in-php – TehSphinX