$feed = 'myfeed';
$xml = simplexml_load_file($feed);
foreach( $xml->productinfo as $productinfo )
{
$product_category = $productinfo->category;
$product_description = $productinfo->description;
now i inserv each product categor and description into my table.
}
I’m storing the products data, category and description in my database.
Problem is the feed has about 5000 products, in 10 categories. I don’t neet to get hundreds of products for each category, I just need about 50. How can I limit the foreach loop, so when for example it loops through 50 tv’s, stops and loops through 50 microwaves… and so on.
Any ideeas?
Ty!
ok,if i unserstood it correct you need something like this :
so if you have a product_category lets say tv :
and if you have a product_category lets say microwave :