不能因爲我得到這個作爲我的輸出 處理此錯誤在這裏輸入的代碼PHP錯誤:試圖讓非對象的屬性
注意:試圖讓非對象的財產 C:\ XAMPP \ htdocs中\ SEO \ seo.php上線161注:試圖獲得非對象的屬性 在C:\ XAMPP \ htdocs中\ SEO \上線162
和
seo.php注意:試圖讓非對象的屬性在C:\ XAMPP \ htdocs中\ SEO \ seo.php上 線163頁局:0域管理局:0外部鏈接:
,這是代碼
$accessID = " xxxx ";
$secretKey = " xxxxxxxx";
$domain = "$sig";
$expire_in = time() + 500;
$SignIn = $accessID."n".$expire_in;
$binarySignature = hash_hmac('sha1', $SignIn, $secretKey, true);
$urlSafeSignature = urlencode(base64_encode($binarySignature));
$data = "103079215140";
$curlURL = "http://lsapi.seomoz.com/linkscape/url-metrics/?Cols=".$data."&AccessID=".$accessID."&Expires=".$expire_in."&Signature=".$urlSafeSignature;
$Domains = array($domain);
$Domai = json_encode($Domains);
$options = array(
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => $Domai
);
$ch = curl_init($curlURL);
curl_setopt_array($ch, $options);
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response,true);
$pageAuthority=round($result[0]->upa,0);
$domainAuthority=round($result[0]->pda,0);
$externalLinks=$result[0]->ueid;
echo "Page Authority:".$pageAuthority."<br/>";
echo "Domain Authority:".$domainAuthority."<br/>";
echo "External Links:".$externalLinks."<br/>";
可以突出這行是161? – Gerton
'$ result [0]'的值是多少? – bruceyyy
檢查$ result數組,可能由於解析問題而爲空... print_r($ results); – maximus