Salut, comme je trouve rien qui me convient pour faire mes classements, j ai decide de mettre a programmer mon propre module mais je ne suis pas trop cale pour parser un fichier xml en php
voici le lien du fichier xml a parser :
http://www.ftpntfrance.org/result/1R1.xmlvoici mon code pour recuperer les données :
<?php
try{
if(!@$fluxrss=simplexml_load_file('http://www.ftpntfrance.org/result/1R2.xml')){
throw new Exception('Flux introuvable');
}
if(empty($fluxrss->RaceResults))
throw new Exception('Flux invalide');
echo '<h3>'.(string)$fluxrss->RaceResults->ServerName.'</h3>
<p><strong>Course du :</strong> '.(string)$fluxrss->RaceResults->TimeString.'<br />
<strong>Distance du circuit :</strong> '.(string)$fluxrss->RaceResults->TrackLength.' Km<br />
<strong>Nombre de tours :</strong> '.(string)$fluxrss->RaceResults->RaceLaps.'<br />
<strong>Temps de course :</strong> '.(string)$fluxrss->RaceResults->RaceTime.'<br /></p>
';
echo '<table width="100%" border="1">
<tr>
<td>Pilotes</td>
<td>Numero</td>
<td>Team</td>
<td>Depart</td>
<td>Arrive</td>
<td>Top</td>
<td>Point</td>
</tr>
<tr>
';
foreach($fluxrss->RaceResults->Race->Driver as $Driver){
echo
'<td>',$Driver->Name, '</td>',
'<td>',$Driver->CarNumber, '</td>',
'<td>',$Driver->TeamName, '</td>',
'<td>',$Driver->GridPos, '</td>',
'<td>',$Driver->Position,'</td>',
'<td>',$Driver->BestLapTime,'</td>',
'<td>',$Driver->Points,' Pts</td></tr>',PHP_EOL;
}
echo'
</table>';
}
catch(Exception $e){
echo $e->getMessage();
}
?>
quelqu un si connais ? quelqu un peu m'aider ?
Le soucis c est qu il parse qu un seul
Lap alors qu il y en a plusieurs, apres je n arrive pas a faire la conversion segonde en minute ??