Ver Mensaje Individual
  #2 (permalink)  
Antiguo 16/12/2019, 20:21
tuadmin
 
Fecha de Ingreso: abril-2006
Mensajes: 583
Antigüedad: 18 años
Puntos: 120
Respuesta: Leer XML con varios nodos

usa las funciones nativas de php para tratar XML, si solo necesitas Leer usa SIMPLEXML

en la web oficial ay mas ejemplos

https://www.php.net/manual/en/functi...-load-file.php

Código PHP:
Ver original
  1. <?php
  2. $xml = '<?xml version="1.0" encoding="UTF-8" ?>
  3. <rss>
  4.    <channel>
  5.        <item>
  6.            <title><![CDATA[Tom & Jerry]]></title>
  7.        </item>
  8.    </channel>
  9. </rss>';
  10.  
  11. $xml = simplexml_load_string($xml);
  12.  
  13. // echo does the casting for you
  14. echo $xml->channel->item->title;
  15.  
  16. // but vardump (or print_r) not!
  17. var_dump($xml->channel->item->title);
  18.  
  19. // so cast the SimpleXML Element to 'string' solve this issue
  20. var_dump((string) $xml->channel->item->title);
  21. ?>
__________________
Mis aportes te ayudaron??, te hicieron ahorrar valiosos tiempo??, si quieres puedes agradecerme con un Gracias o con una donacion
https://paypal.com/pools/c/8lmNLmWnG9