How to obtain object arrays-php Tutorial

Source: Internet
Author: User
How to obtain the Object array AccessToken Object ([type] => MAC [accessToken] => 242762 | signature [refreshToken] => [macKey] => signature [macAlgorithm] => hmac-sha-1)


How can I obtain the value of accessToken?


Reply to discussion (solution)

AccessToken-> type

AccessToken-> type
Echo $ obj-> AccessToken-> type ;??
No.

$ Obj = new AccessToken ();
$ Obj-> type;

$ Obj = new AccessToken ();
$ Obj-> type;
Fatal error: Class 'accesstransferen' not found in F: \ wamp \ www \ phpcms \ test. php
According to what you wrote, an error is reported.
Originally, this is an array of objects.

How can you guess if you paste the code?

If it is print_r ($ obj); you can get the result.
Then $ obj-> accessToken is what you want

$ Obj-> accessToken

AccessToken indicates that the data after an object is the key value of this object. The value of this object is the object name-> key name.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.