我有这个数组:
$client = new OAuth2\Client($client_id, $client_secret, $region, $locale, $redirect_uri);
$array = array('id'=>'13146');
$type = 'quest';
$r = $client->fetch($type,$array);
echo '<pre>';
print_r ($r);
echo '</pre>';
?>
输出:
[result] => Array
(
[id] => 13146
[title] => Generosity Abounds
[reqLevel] => 77
[suggestedPartyMembers] => 0
[category] => Icecrown
[level] => 80
)
我只想读出[标题]和[类别]。我尝试了几种解决方案,但对我来说没有任何作用。感谢。
答案 0 :(得分:1)
要访问title
和category
,您需要执行此操作:
echo $r['result']['title']; // Generosity Abounds
echo $r['result']['category']; // Icecrown