如何从对象中检索数据,php [关闭]

I have an object that outputs this on print_r:

Dropbox\Client Object
(
    [accessToken:Dropbox\Client:private] => secret
    [clientIdentifier:Dropbox\Client:private] => examples-web-file-browser
    [userLocale:Dropbox\Client:private] => 
    [apiHost:Dropbox\Client:private] => api.dropbox.com
    [contentHost:Dropbox\Client:private] => api-content.dropbox.com
    [root:Dropbox\Client:private] => 
    [host] => Dropbox\Host Object
        (
            [api:Dropbox\Host:private] => api.dropbox.com
            [content:Dropbox\Host:private] => api-content.dropbox.com
            [web:Dropbox\Host:private] => www.dropbox.com
        )

)

How do I get just the value "secret"?

Update: var_dump($dbxClient);

outputs:

object(Dropbox\Client)#3 (7) {
  ["accessToken":"Dropbox\Client":private]=>
  string(64) "HrouVh2oRTcAAAAAAAAAARYOdXzK5tA9lCscE24fdnVnt5wYYPSSaK8nITv4PFtc"
  ["clientIdentifier":"Dropbox\Client":private]=>
  string(25) "examples-web-file-browser"
  ["userLocale":"Dropbox\Client":private]=>
  NULL
  ["apiHost":"Dropbox\Client":private]=>
  string(15) "api.dropbox.com"
  ["contentHost":"Dropbox\Client":private]=>
  string(23) "api-content.dropbox.com"
  ["root":"Dropbox\Client":private]=>
  NULL
  ["host"]=>
  object(Dropbox\Host)#2 (3) {
    ["api":"Dropbox\Host":private]=>
    string(15) "api.dropbox.com"
    ["content":"Dropbox\Host":private]=>
    string(23) "api-content.dropbox.com"
    ["web":"Dropbox\Host":private]=>
    string(15) "www.dropbox.com"
  }
}

In the class file lib/Dropbox/Client.php on line 18 of the official PHP SDK for Dropbox there is a method getAccessToken() which will return the value of the property accessToken.

So in your case this should do the job:

var_dump($dbxClient->getAccessToken());

In future please have a look at the files of SDKs and APIs first before you posting such questions.