我一直在嘗試3天讓PHP使用PHP和httpful顯示這個測試JSON的ID。數組中的Httpful JSON
任何人有任何想法,因爲我已經嘗試了不同的組合加載,甚至嘗試創建一個處理程序解碼爲一個數組...我只是在PHP吮吸?
// Make a request to the GitHub API with a custom
// header of "X-Trvial-Header: Just as a demo".
<?php
include('\httpful.phar');
$url = "https://jsonplaceholder.typicode.com/posts";
$response = Httpful\Request::get($url)
->expectsJson()
->send();
echo "{$response[0]['id']}";
?>
抱歉忽略我最後的評論!我已經刪除它 – Yazan