Grabbing data from output
I have an object I'm trying to get data from. But I seem to be stuck, any
help would be great, Thanks.
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");
}
}
Example of output so far:
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"
Basically looking to grab the data from each.
No comments:
Post a Comment