Created
March 5, 2012 03:29
-
-
Save RSquaredSoftware/1976308 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//connect to the xml and create an xml object from it | |
$session = curl_init('http://www.chinabuye.com/mivec/rss/data/apple.xml'); | |
curl_setopt($session, CURLOPT_RETURNTRANSFER,true); | |
$xml = new SimpleXMLElement(curl_exec($session)); | |
//craete the csv file | |
$apple = "apple.csv"; | |
$handle = fopen($apple, 'a'); | |
$data = array(); | |
foreach ($xml->xpath("item") as $item){ | |
echo $item->name; | |
echo $item->description; | |
echo $item->sku; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment