-1
我有這樣迴路JSON PHP有有2個數據
{"host":[{"name":"*","type":"A","address":"89.163.141.230","hostid":"391162691"},{"name":"www","type":"A","address":"89.163.141.230","hostid":"391453684"}],"DomainServices":{"EmailForwarding":"True","HostRecords":"True"},"Command":"GETHOSTS","APIType":"API","Language":"eng","ErrCount":"0","ResponseCount":"0","MinPeriod":"1","MaxPeriod":"10","Server":"SJL0VWAPI12","Site":"whois","IsLockable":"True","IsRealTimeTLD":"True","TimeDifference":"+08.00","ExecTime":"0.064","Done":"true","RequestDateTime":"1\/17\/2016 5:49:26 AM","debug":{}}
這2個數據JSON數據,你可以看到它有,
我的PHP代碼:
<?php
$array = file_get_contents('example.com/api.php?whois=facebook.com');
$decode = json_decode($array, true);
echo $decode['host']['address'];
?>
,但它只是呼應1數據。如何循環它?
你可以發佈什麼$解碼包含? –