如何使用PHP获取数组中的确切键值?

This is my code

$response = json_decode($result);
print_r($response);

and I got the result

  stdClass Object ( [type] => http://developer.mailchimp.com/documentation/mailchimp/guides/error-glossary/ [title] => Resource Not Found 
[status] => 404 
[detail] => The requested resource could not be found. 
[instance] => ) 

and I added

foreach($response as $key=>$val)
{
    echo $key.'='.$val.'<br>';
}

But I want how to get exact key and value for detail. How to get it? Thanks

foreach($response as $key => $val){
  echo "Key: " . $key . "Value: " . $val->detail;
}

There is a problem in json_decode(), you have to pass 2 parameter "true", like this..

$response = json_decode($result,true);
print_r($response);