Does not return all xml results

Asked

Viewed 39 times

1

I have a prolema in this xml reader, it only reads the first xml item, anyone can help me? Thanks

<?php
$link = "http://war.deathface.com.br/wo/api_getserverinfo.xml";
$xml = simplexml_load_file($link); 

foreach($xml -> news as $dados){ 
    echo "<strong>Título:</strong> ".utf8_decode($dados -> news['name'])."<br />";
    echo "<br />";
}

1 answer

2


try another loop

foreach($xml->news as $v) { 
    foreach($v as $vv){
    echo "<pre>";
        print_r($vv['name']);
    echo "</pre>";
    }
}
  • vlw, it worked out..

  • You may have another way by the function xml_read_file lib().

Browser other questions tagged

You are not signed in. Login or sign up in order to post.