Remove from PHP array array object Tip: Undefined property: stdClass :: $ subject

PHP is due to the increased rigor, we must first add the next judge whether there is an array of values, then get in!
     if (isset ($ result-> access_token )) {

     }

$ curl = 'https://api.weixin.qq.com/sns/oauth2/access_token?appid='.$this->app_id.'&secret='.$this->app_secret.'&code='.$code . '& grant_type = authorization_code'; 
        $ Content = $ the this -> _ Request ($ curl); 
        $ Result = of json_decode ($ Content); 

        // first determine whether there is a value, and then pulling the user information access_token and OpenID 
        iF (isset ( result- $> the access_token)) { 
            $ webAccess_token = $ result-> the access_token; 
            $ OpenID = $ result-> OpenID; 
        }

  

Guess you like

Origin www.cnblogs.com/weilianguang/p/10990007.html