今天在調(diào)用方法時(shí),發(fā)現(xiàn)返回值為:object,導(dǎo)致不能通過數(shù)組方式取值,搗鼓半天才知道這么取;
print_r(object);
(
[items:protected] => Array
(
[0] => stdClass Object
(
[user_id] => 488579
[user_type] => 1
[sex] => 1
[nick] => 自動(dòng)化專用五
[phone] => 13111111115
)
[1] => stdClass Object
(
[user_id] => 494385
[user_type] => 1
[sex] => 1
[nick] => 123
[phone] => 15111111111
)
)
)
例:取第一組數(shù)據(jù)中 user_type的值
$user_type = $object[0]->user_type;
@陰-2016-12-06 18:14:52