我有一个我试图从中获取数据的对象。但我似乎被卡住了,任何帮助都会很棒,谢谢。
function att($prop, $what){
$reflObj = new ReflectionObject($prop);
$get = $reflObj->getProperty('attributes');
$get->setAccessible(true);
$info = $get->getValue($prop);
foreach($info as $inf){
$reflObj = new ReflectionObject($inf);
$title = $reflObj->getProperty('name');
$title->setAccessible(true);
$description = $title->getValue($inf);
var_dump("$description");
}
}
到目前为止的输出示例:
string(11) "< Min Child"
string(9) "< Train S"
string(4) "<Pub"
string(5) "<Shop"
string(7) "Balcony"
string(4) "Bath"
string(9) "Bathrooms"
string(3) "BBQ"
string(5) "Beach"
string(9) "Bed Linen"
string(8) "Internet"
string(15) "Central Heating"
string(7) "Coast <"
string(3) "Cot"
基本上希望从每个中获取数据。