我需要使用Ebay API从Ebay获取所有子类别。我在它下面写代码只是获得根级别类别。任何人都可以指导我如何获得父类别的子类别。
function curl($url){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_FAILONERROR,1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
$url= 'http://open.api.ebay.com/Shopping?callname=GetCategoryInfo&appid=3b5sdsdsdsd&siteid=0&CategoryID=1&version=949IncludeSelector=ChildCategories';
$xml = curl($url);
$xml = simplexml_load_string($xml);
print_r($xml);