Page 1 of 1

Reverse the reading of xml

Posted: Tue Apr 15, 2008 4:51 am
by biggipsy
Hello !

I write this code for read the xml

<?


for ($i=0;$xml->no[$i]->marca !="";$i++) {

?>
<td height="30" bgcolor="#97A7AE" class="textovisualizar"><strong><?php echo $xml->no [$i]->titulo;?></strong></td>


and work's....

But i need to reverse the reading of xml, i know from array_reverse it works.......But i wanted from my example....

Someone helps me?

Thank's

Re: Reverse the reading of xml

Posted: Tue Apr 15, 2008 5:35 am
by Chris Corbyn

Code: Select all

for ($i = count($xml->no) - 1; ($i > 0 && $xml->no[$i]->marca !=""); $i--) {
?

Re: Reverse the reading of xml

Posted: Tue Apr 15, 2008 5:45 am
by biggipsy
1. for ($i = count($xml->no) - 1; ($i > 0 && $xml->no[$i]->marca !=""); $i--) {

Work's thank's for help