Forum Moderators: coopster
<results>
<td class="titlelink2" width="75%">
<a class="offerHeading" href="http://www.site.com/product_view/id/44.htm" target="_blank">Nike Jordan Shoes</a>
</td>
<td class="titlelink2" width="75%">
<a class="offerHeading" href="http://www.site.com/product_view/id/44.htm" target="_blank">Nike Adidas Puma Timberland Hogan Prada Jordan Sports Shoes Jacket</a>
</td>
</results>
the issue is that its not parsing attributes of anchor tags and just returning the text of Anchor rather than the URL and other attributes. How should I retrieve it?
$xml = simplexml_load_string($XML_STRING);
foreach($xml->td[0]->a[0]->attributes() as $name => $value) {
echo $name.' = "'.$value.'"<br>';
}
Outputs...
class = "offerHeading"
href = "http://www.site.com/product_view/id/44.htm"
target = "_blank"