我对对象不是很好,所以我想知道是否有人可以帮助我。
我希望从这个对象中回显数据,之前的级别也被归类为受保护的,我已经解决了这个问题,但我似乎无法从新对象中提取任何内容。
获取对象的原始代码:
$addrProp = $reflObj->getProperty('images');
$addrProp->setAccessible(true);
echo("<strong>Images:</strong>");
var_dump($addrProp->getValue($property));
输出:
array(17) {
["474sp1190714.jpg?APIKEY=homefromhome&hash=31b3f7b1b377184e8cb8fb64d434a11a4c3446c1091535ef6db4e119689a6372"]=>
object(tabs\api\property\Image)#350 (7) {
["filename":protected]=>
string(106) "474sp1190714.jpg?APIKEY=homefromhome&hash=31b3f7b1b377184e8cb8fb64d434a11a4c3446c1091535ef6db4e119689a6372"
["title":protected]=>
string(8) "P1190714"
["alt":protected]=>
string(0) ""
["url":protected]=>
string(74) "http://hh.api.carltonsoftware.co.uk/image/normal/1000x750/474sp1190714.jpg"
["height":protected]=>
int(750)
["width":protected]=>
int(1000)
["apiPath":protected]=>
string(35) "http://hh.api.carltonsoftware.co.uk"
}
["474sp1190718.jpg?APIKEY=homefromhome&hash=31b3f7b1b377184e8cb8fb64d434a11a4c3446c1091535ef6db4e119689a6372"]=>
object(tabs\api\property\Image)#351 (7) {
["filename":protected]=>
string(106) "474sp1190718.jpg?APIKEY=homefromhome&hash=31b3f7b1b377184e8cb8fb64d434a11a4c3446c1091535ef6db4e119689a6372"
["title":protected]=>
string(8) "P1190718"
["alt":protected]=>
string(0) ""
["url":protected]=>
string(74) "http://hh.api.carltonsoftware.co.uk/image/normal/1000x750/474sp1190718.jpg"
["height":protected]=>
int(750)
["width":protected]=>
int(1000)
["apiPath":protected]=>
string(35) "http://hh.api.carltonsoftware.co.uk"
}
任何单个输出的例子(foreach 或其他东西)都会很棒。谢谢!