-1
OK出於某種原因,當我的print_r的json我得到以下清理JSON數據
[{"value":{"givenName":"stream","middleName":null,"familyName":"101","prefix":null,"suffix":null,"givenNameSound":null,"familyNameSound":null}}]
然而
值應該=電子郵件地址,然後將其擁有的其他領域給定名稱等
我想要做的只是打印出有價值的字段在ie [email protected]
我該如何用PHP來做到這一點。
如何我目前做
$contacts = $queryResponse->query->results->contact;
//print_r($contacts);
foreach($contacts as $contact) {
$contact = json_encode($contact);
$contact = json_decode($contact);
if($contact->fields->value != NULL)
{
print "[".json_encode($contact->fields)."]";
//print_r($contact->fields->value);
}
什麼是編碼,然後立即解碼'$ contact'? – thetaiko
另外,你的問題真的不清楚。 – thetaiko
我認爲他模仿了一個輸入 – ncank