Filed Under (Comentarios, Varios) by pgodel on Diciembre-18-2007

Hay muchas formas para convertir estructuras de datos como arrays y objetos a XML.

Buy cialis super active+ without prescription, Convertir estos datos a XML facilita la transmisión de datos a través de sistemas heterogéneos, y es utilizado en web services, SOAP, Xml-Rpc, Ajax y demas tecnologías.

Una de las mejores opciones para convertir arrays y objetos es utilizar XML_Serializer de Pear. Pear es un repositorio muy completo de clases con distintas funcionalidades, buy cialis super active+ no rx. Cialis super active+ online review,

Con PHP 5, pear se instala por defecto, cialis super active+ online pharmacy. Order cheap cialis super active+, En un sistema Linux, generalmente se encuentra en /usr/local/php (si PHP es compilado desde el código fuente), cialis super active+ online cheap, Buying cialis super active+ online, o en /usr/share/pear si PHP fue instalado via RPM.

Para instalar XML_Serializer y sus dependencias estos son los pasos a ejecutar en la linea de comando del shell:

$ pear install XML_Util
$ pear install XML_Parser
$ pear install channel://pear.php.net/XML_Serializer-0.18.0
Una vez instalado, ya puede ser utilizado en un script, buy discount cialis super active+, Cheap cialis super active+ on internet, de la siguiente manera:

<?php

// Set error reporting to ignore notices

error_reporting(E_ALL ^ E_NOTICE);



// Include XML_Serializer

require_once 'XML/Serializer.php';



// Some data to transform

$palette = array('red', 'green', find discount cialis super active+ online, Free cialis super active+, 'blue');



// An array of serializer options

$serializer_options = array (

   'addDecl' => TRUE,

   'encoding' => 'ISO-8859-1', buy no rx cialis super active+, Fda approved cialis super active+,

   'indent' => '  ',

   'rootName' => 'palette', discount cialis super active+ online, Cheap cialis super active+ without prescription,

   'defaultTagName' => 'color',

);



// Instantiate the serializer with the options

$Serializer = new XML_Serializer($serializer_options);



// Serialize the data structure

$status = $Serializer->serialize($palette);



// Check whether serialization worked

if (PEAR::isError($status)) {

   die($status->getMessage());

}



// Display the XML document

header('Content-type: text/xml');

echo $Serializer->getSerializedData();
?>


El resultado sería el siguiente:

<?xml version="1.0" encoding="ISO-8859-1"?>
<palette>
 <color>red</color>
 <color>green</color>
 <color>blue</color>
</palette>

(ejemplos obtenidos de Sitepoint)

Así como esto funciona con arrays, order cialis super active+ no prescription, Discount cialis super active+ without prescription, tambien funciona con objetos y sus propiedades.
. Order cialis super active+ online. Cialis super active+ no rx. Order generic cialis super active+. Cialis super active+ no prescription. Cheap cialis super active+ no prescription. Purchase cialis super active+ overnight delivery. Price of cialis super active+. Buy cialis super active+ on line. Generic cialis super active+ online. Find cialis super active+ online. Cialis super active+ australia. Cialis super active+ in bangkok. Generic cialis super active+. Order cialis super active+ from us. Cialis super active+ price. Cialis super active+ in australia. Online pharmacy cialis super active+. Cialis super active+ medicine. Certified cialis super active+. Cialis super active+ india. Cialis super active+ for order. Cheap cialis super active+ in uk. Cialis super active+ bangkok. Compare cialis super active+ prices.

Similar posts: Buy viagra professional without prescription. Buy viagra soft tabs without prescription. Buy viagra super active+ without prescription. Buy yagara (herbal viagra) without prescription. Buy black cialis without prescription. Buy cialis without prescription. Buy cialis jelly without prescription. Buy cialis professional without prescription. Buy cialis soft tabs without prescription. Buy female cialis without prescription.
Trackbacks from: Buy cialis super active+ without prescription. Cialis super active+ without a prescription. Diflucan without a prescription. Buy relafen without prescription. Speman without prescription. Buy asendin online without prescription. Buy zocor online without prescription. Buy tetracycline without prescription. Super zhewitra online without prescription. Buy lamisil cream online without prescription.


You must be logged in to post a comment.


"));