2016-07-15 87 views
1

我需要使用Ebay API從Ebay獲取所有兒童類別。我在它下面寫代碼只是獲取根級別的類別。任何人都可以指導我如何獲得父類別的子類別。得到兒童類別Ebay API

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); 

回答