我有这个代码
$client = json_decode($client);
echo "<pre>";
print_r($client);
在那里生产
Array
(
[0] => stdClass Object
(
[id] => 1
[name] => Jojohn@doe.com
[email_verified_at] =>
[password] => $2y$10$pAvJ9/K7ZPOqw10WhfmToumK0TY1XihY8M9uAEEs4GkHZr4LdGc4e
[remember_token] =>
[created_at] => 2020-07-29 21:08:02
[updated_at] =>
[userid] => 2
[account_rep] => 3
)
)
我的问题是如何获取我尝试过的 name 和 account_rep 的值
echo $client['0']['object']['name'];
但这不起作用它只是抛出一个错误
Cannot use object of type stdClass as array
慕码人8056858