I am Parsing XML currently using:
$data = simplexml_load_string($xmlFile);
foreach($data->item as $key => $current){
echo($current);
}
However I'm wondering, if a hit an element that looks like this:
<thumbnail url="http://foo.bar" height="225" width="300"/>
How do i pull the inner parts of this? (height, url, width)
Thanks!
foreach($data->item->thumbnail as $thumbnail) {
$url = $thumbnail['url'];
$height = $thumbnail['height'];
$width = $thumbnail['width'];
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With