views:

19

answers:

1

I'm parsing an iTunes feed, there are 3 image sizes within the feed and I'm not sure how to fetch the largest one.

The iTunes Feed example:

                <im:image height="53">http://a1.image.53x53-50.jpg&lt;/im:image&gt;

                <im:image height="75">http://a1.image.75x75-65.jpg&lt;/im:image&gt;

                <im:image height="100">http://a1.image.100x100-75.jpg&lt;/im:image&gt;

My class:

function get_app_image() 
{
    $data = $this->get_item_tags(SIMPLE_NAMESPACE_IM, 'image');
    return $data['0']['data'];
}

php to output the image:

<img src="<?php echo $item->get_app_image(); ?>" class='alignleft1' height="100" width="100" />

It always outputs the first/smallest image, and I'm not sure how to define the largest?

A: 

The solution was very simple. Change $data['0'] to data['2'] which represented the 3rd image of the same namespace.

illtemper