Posted in

Crear un xml al vuelo con php

header("Content-Type: text/xml");
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Fecha en el pasado

print ('<?xml version="1.0" encoding="ISO-8859-15" ?>'); 

print ('<fondos>');

for($e=0;$e<$i;$e++){

echo '<fondo>';

//echo '<id>' . $datos[$e]['id'] . '</id>';

echo '<imagen>' . $datos[$e]['imagen'] . '</imagen>';

echo '<tamanyo_pixels>' . $datos[$e]['tamanyo_pixels'] . '</tamanyo_pixels>';

echo '<peso>' . $datos[$e]['tamanyo_bytes'] . '</peso>';

echo '</fondo>';

}

print ('</fondos>');

Deixa un comentari

L'adreça electrònica no es publicarà. Els camps necessaris estan marcats amb *


The reCAPTCHA verification period has expired. Please reload the page.