In theory, getting a reliable feed should be easy, and actually parsing the feed and inserting or updating the content in a database isn't difficult with PHP either.
I`ve always found that its much harder than it seems though, and you still have to frequently manually check the data, because its the old case of Garbage in, Garbage out. Your code can work 100%, but if theres bad data in the feed its very difficult to automatically weed it out.
Technically though, its fairly simple to parse the feed data using PHP, whether its in CSV or XML format.
With CSV, you use the file commands (fopen, fread, fclose) to read in the data from the CSV file. You then use the explode command to split the feed into an array, with a line in each cell, splitting by the newline character \n. You then use foreach() to look through each cell of the array, and use explode again to split the line by the delimiter (usually a comma or pipe (|) ), which gives you an array with each field in the row. You can then either insert this into the database, or use it to update the database by referencing a piece of unique data such as the product code.
XML is even simpler really, if you have the XML extension in your version of PHP. An example which processes an Affiliate Window merchants XML feed is:
PHP Code:
<?php
$xml = simplexml_load_file("/home/vpsnameserver/public_html/test/awProductFeed.xml");
foreach($xml->merch->prod as $product){
echo "Name: " . $product->name . "<br>";
echo "AW Cat ID: " . $product->cat->awCatId . "<br>";
echo "Brand: " . $product->brand . "<br>";
echo "AW Link: " . $product->awLink . "<br>";
echo "Delivery Cost: " . $product->delCost . "<br>";
echo "Price: " . $product->price->search . "<br>";
echo "--------------------------" . "<br>";
}
?>
Thats all the code you need to parse the feed and display it on screen, you just need to modify it to insert into, or update, the database.
There is software out there to take do it, such as Price Tapestry, but i`ve never used any of these so can't comment on them.