Ver Mensaje Individual
  #2 (permalink)  
Antiguo 28/03/2013, 06:23
xoceunder
 
Fecha de Ingreso: junio-2012
Ubicación: En el Mundo
Mensajes: 759
Antigüedad: 11 años, 10 meses
Puntos: 10
Respuesta: Duda en poder mostrar datos de un xml

ok ya lo encontre la funcion corecta pero tengo un problema que no organiza en orden y tambien muetra el mismo numero multiple

aqui esta lo que ya logre hacer funcionar

Código PHP:
Ver original
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <title>Servicio Up</title>
  5. </head>
  6.  
  7. <body>
  8. <table width="200" border="1">
  9.   <tr>
  10.     <td align="center">Canales Activos</td>
  11.   </tr>
  12. <?php  
  13.  
  14. $ip = "192.168.1.1";
  15. $port = "5050";
  16. $user = "user";
  17. $pass = "pass";
  18. $i = 0;
  19.  
  20. $xml = simplexml_load_file("http://".$user.":".$pass."@".$ip.":".$port."/cache-listening.xml?server");
  21.  
  22. $currently = "currently-active-cache";
  23. $cache = "cache-element";
  24.  
  25. foreach($xml->$currently->provider->$cache as $sids) {
  26.  
  27.  $sid = (string)$sids->attributes()->sid[$i];
  28.  
  29.   echo "<tr>";
  30.   echo "<td>".$sid."</td>";
  31.   echo "</tr>";
  32.  
  33.  $i++;
  34. }
  35.  
  36. ?>
  37. </table>
  38. </body>
  39. </html>