Ver Mensaje Individual
  #2 (permalink)  
Antiguo 16/02/2011, 22:57
Avatar de dual3nigma
dual3nigma
Colaborador
 
Fecha de Ingreso: febrero-2010
Ubicación: Ciudad de México
Mensajes: 295
Antigüedad: 14 años, 2 meses
Puntos: 122
Respuesta: Borrar contenido de XML y remplazarlo

Tendrías que estar haciendo algo así:
Código PHP:
Ver original
  1. <?php
  2.     ob_start();
  3.     echo '<?xml version="1.0" encoding="utf-8"?>'; ?>
  4. <sitio>
  5. <?php
  6. while( $dato = mysql_fetch_array($query)): ?>
  7.    <page>
  8.        <title><?php echo $dato['title'] ?></title>
  9.        <url><?php echo $dato['url'] ?></url>
  10.        <content><?php echo $dato['content'] ?></content>
  11.    </page>
  12. <?php
  13.        endwhile; ?>
  14. </sitio>
  15. <?php $buffer = ob_get_clean();
  16.         file_put_contents('miarchivo.xml', $buffer); ?>