2010-03-23 39 views
1

請告訴我如何製作OPML解析器。我的代碼,但它不工作的所有通用OPML文件:PHP OPML解析器

if (file_exists('test.opml')) { 
    $xml =simplexml_load_file('test.opml'); 
} 

for($i=0;$i<=count($xml);$i++) { 
    $array=array($xml->body->outline->outline[$i]); 
    $key=(array_keys($array)); 
    foreach ($array as $key) { 
     echo "<strong>".($key['xmlUrl'][0])."</strong><br/>"; 
    } 
} 

回答