archivo.xml
Código XML:
Ver original
<fslb> <cache-listeners> <listener> <connected-client enabled="1" ip-address="192.168.1.81" time-connected="1:16:55"/> </listener> </cache-listeners> <currently-active-cache> <provider> <cache-element sid="0167" source="External" /> <cache-element sid="0137" source="External" /> <cache-element sid="0230" source="Internal" /> <cache-element sid="0159" source="External" /> </provider> </currently-active-cache> </fslb>
index.php
Código PHP:
Ver original
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Servicio Up</title> </head> <body> <table width="200" border="1"> <tr> <td align="center">Canales Activos</td> </tr> <?php $ip = "192.168.1.1"; $port = "5050"; $user = "user"; $pass = "pass"; $i = 0; $currently = "currently-active-cache"; $cache = "cache-element"; foreach($xml->$currently->provider->$cache as $sids) { $xmlsid = ""; $xmlsid = (string)$xml->$currently->provider->$cache->attributes()->sid; $info[$xmlsid."-sid"] = (string)$xml->$currently->provider->$cache->attributes()->sid; echo "<tr>"; echo "<td>".$xmlsid."</td>"; echo "</tr>"; $i++; } ?> </table> </body> </html>
me muestra todos el listado pero con un solo sid
ejemplo
0167
0167
0167
0167
en vez que lo haga asi como el listado
0137
0159
0167
0230
que estoy haciendo mal