Blogger Information
Blog 43
fans 2
comment 2
visits 113492
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
php 获取stdClass Object中的值
朝游东海
Original
2098 people have browsed it

print_r(json_decode($data));exit;

stdClass Object

(

    [openId] => oXAn10DtGNKDz421q_ATefmwAgrI

    [nickName] => 朝游东海

    [gender] => 1

    [language] => zh_CN

    [city] => 

    [province] => 

    [country] => 

    [avatarUrl] => https://wx.qlogo.cn/mmopen/vi_32/HvsSkXDC0A2hxOHictAG4gJunWdznmxAAyxjXpP53Getslo4AfbkhDsvNnVqXmwOqOxRPDDy3m53Jahcn7EACnA/132

    [watermark] => stdClass Object

        (

            [timestamp] => 1528705900

            [appid] => wx21d0c78aba5a30b1

        )

)



获取值

$tempData = json_decode($data,true);

$temp['name'] = $tempData['nickName'];
使用true,转数组,然后通过数组获取值



Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post