PHP Y XML

cybersersupremo
19 de Enero del 2005
Hola buenas, tengo un problemilla... os lo espliko.

Accedo a un arhivo xml que tienesta estructura:

<?xml version="1.0" encoding="ISO-8859-15" ?>
<!DOCTYPE drt (View Source for full doctype...)>
- <drt max_page="10" page="1" results_displayed="56" total_results="542">
- <ressource>
<lib>panda Family</lib>
<id>6365</id>
<url_download>http://portal-extremo.sonnerie.net/external/DrtTop/dl.php?f=c_15&a=portal-extremo&type=15&id=6365&son_nom=panda%20Family&logo_image=STANI_102_022_20&lang=ES&ps=©%20Stock%20Image%20-%20Mobibase&mpf=0&c=ES</url_download>
<file>http://pics.homere.jmsp.net/t_15/64x64/STANI_102_022_20.jpg</file>
<copyright>© Stock Image - Mobibase</copyright>
</ressource>
- <ressource>
<lib>Tigre</lib>
<id>132</id>
<url_download>http://portal-extremo.sonnerie.net/external/DrtTop/dl.php?f=c_15&a=portal-extremo&type=15&id=132&son_nom=Tigre&logo_image=76149&lang=ES&ps=&mpf=0&c=ES</url_download>
<file>http://pics.homere.jmsp.net/t_15/64x64/76149.jpg</file>
</ressource>
...
<first_url>a=portal-extremo&t=15&l=ES&cat=1005&act=CONT&p=1&np=56&q=&c=ES&h=1</first_url>
<last_url>a=portal-extremo&t=15&l=ES&cat=1005&act=CONT&p=10&np=56&q=&c=ES&h=1</last_url>
<next_url>a=portal-extremo&t=15&l=ES&cat=1005&act=CONT&p=2&np=56&q=&c=ES&h=1</next_url>
</drt>

Bueno yo accedo inclyendo la libreria.. con un archvo que me han dado y luego accedo asi..
:

$sFile = 'http://mpxml.mediaplazza.com/xml_act.php?l=ES&c=ES&act=CONT&a='.$a.'&h='.$h.'&t=15&p='.$p.'&np=56&preview=64x64&cat='.$cat.'';
$aArray = MPxmlParse($sFile); // parsing of the file
$aRess = $aArray['ressources']; //array with all content
$aInfos = $aArray['infos']; //array with all informations (max_page, total_results...)

$i='0';
foreach ($aInfos as $aInfo) {

$max[i]=$aInfo["total_results"];
if ($i=='0'){
echo $max[i];
}
$i++;
}


El problema es que si max_page es 10, me escribe solo 1.. eso porque será???

El codigo

if ($i=='0'){
echo $max[i];
}

tiene un fin especifiko, es que al poner max_results le da =. lo qie hace es me va diciendo los numeros de la primera linia.

<drt max_page="10" page="1" results_displayed="56" total_results="542">

por ejemplo, en esta linia deberia dar 10 1 56 542, bueno, pos da, 1 1 5 5 , si os fijais, los primeros digitos, d elo que deberia dar, aunque tampoco entiendo mucho, porqué si pongo max_page me salen los demás, yo pensaba k simplemente, escribiria 10..