0
我有這樣的代碼,但我不能讓這些項正常顯示,我只能說明沒有回聲$數據語句的數據,但不能$項姓或項目生物JSON的file_get_contents和表演項目
$url = 'https://jdublu.com/api/wrsc/json_employee.php?RID=17965'; // path to your JSON file
$data = file_get_contents($url); // put the contents of the file into a variable
$items = json_decode($data, true);
foreach ($items as $item)
{
$name = $item = ["FirstName"];
$bio = $item = ["Bio"];
}
echo $data
請閱讀php基礎知識。 '$ name = $ item = [「FirstName」];'不符合你的期望。 –
$ name = $ item [「FirstName」]; $ bio = $ item [「Bio」]; –