我知道有很多关于 PHP 的可用信息 - var_dump 我的问题是我是否需要从我从返回不同数组对象的 API 接收的转储中选择特定信息....例如下面的转储我需要 characterData 数组下的领域信息我如何选择该信息并存储在 String 变量中。解释我的问题的 php 代码的简短示例将不胜感激......
object(Character)[3]
private 'name' => string 'XXXX' (length=6)
private 'region' => string 'eu' (length=2)
private 'realm' => string 'Defias Brotherhood' (length=18)
private 'characterData' =>
array (size=24)
'lastModified' => float 1363345999000
'name' => string 'Growar' (length=6)
'realm' => string 'Defias Brotherhood' (length=18)
'battlegroup' => string 'Rampage / Saccage' (length=17)
基本上这些信息来自 Battlegroup api
$armory = new BattlenetArmory('EU','Defias Brotherhood');
$armory->setLocale('ru_RU');
// To reset back to default server locale
$armory->setLocale(FALSE);
//initialize the character to get the character object
$character = $armory->getCharacter('XXXX');