using array of objects in php
Posted: Wed Mar 21, 2007 3:12 am
Hi All,
Following is my code snippet.
I am parsing a xml and displaying. But I want to store 'ProductName', 'PriceFrom', 'PriceTo' to an array of objects and then display it.
How do I do that?
Following is my code snippet.
I am parsing a xml and displaying. But I want to store 'ProductName', 'PriceFrom', 'PriceTo' to an array of objects and then display it.
How do I do that?
Code: Select all
for($i=0; $i<$res['totalResultsReturned']; $i++) {
foreach($pob->Result[$i] as $key=>$value) {
echo "<a href=\"{$value->Url}\" target=\"blank\" title=\"Learn More at Yahoo.com\">{$value->ProductName}<a>";
echo " Min. Price $" . "{$value->PriceFrom}";
echo " Max. Price $" . "{$value->PriceTo}";
echo "<hr />\n";
}
}