I am using php xpath to get the values from the below xml feed and php the function.
<FOUND>
<IMAGES>
<IMAGE>
<SMALL>images/small.jpg</SMALL>
<MED>images/med.jpg</MED>
<LARGE>images/large.jpg</LARGE>
<EXTRAL>images/extra.jpg</EXTRAL>
</IMAGE>
<IMAGE>
<SMALL>images1/small.jpg</SMALL>
<MED>images1/med.jpg </MED>
<LARGE>images1/large.jpg</LARGE>
<EXTRAL>images1/extra.jpg</EXTRAL>
</IMAGE>
<IMAGE>
<SMALL>images2/small.jpg</SMALL>
<MED>images2/med.jpg </MED>
<LARGE>images2/large.jpg</LARGE>
<EXTRAL>images2/extra.jpg</EXTRAL>
</IMAGES>
</FOUND>
function img ($id){
$xml=simplexml_load_file("feed1.xml");
//$xml=simplexml_load_string($string);
if (!$xml) {
trigger_error("There was an error",E_USER_ERROR);
}
$images=$xml->xpath('//IMAGE');
return $images;
}
above is only a partial code cz the feed is quite huge.. i would like to know is there are way to grab only the first and third block of image objects, skipping the 2nd block and display the remaining image blocks?
i have a separate huge xml feed which is quite similar to the above feed , its like 80 image object blocks .so i would like to display a message after each 10 blocks. how i do this?
any help will be much appreciated