Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>For those of you not using the PEAR packages, but you've got PHP5 installed. This worked for me: </p> <pre><code>/** * Build A XML Data Set * * @param array $data Associative Array containing values to be parsed into an XML Data Set(s) * @param string $startElement Root Opening Tag, default fx_request * @param string $xml_version XML Version, default 1.0 * @param string $xml_encoding XML Encoding, default UTF-8 * @return string XML String containig values * @return mixed Boolean false on failure, string XML result on success */ public function buildXMLData($data, $startElement = 'fx_request', $xml_version = '1.0', $xml_encoding = 'UTF-8') { if(!is_array($data)) { $err = 'Invalid variable type supplied, expected array not found on line '.__LINE__." in Class: ".__CLASS__." Method: ".__METHOD__; trigger_error($err); if($this-&gt;_debug) echo $err; return false; //return false error occurred } $xml = new XmlWriter(); $xml-&gt;openMemory(); $xml-&gt;startDocument($xml_version, $xml_encoding); $xml-&gt;startElement($startElement); /** * Write XML as per Associative Array * @param object $xml XMLWriter Object * @param array $data Associative Data Array */ function write(XMLWriter $xml, $data) { foreach($data as $key =&gt; $value) { if(is_array($value)) { $xml-&gt;startElement($key); write($xml, $value); $xml-&gt;endElement(); continue; } $xml-&gt;writeElement($key, $value); } } write($xml, $data); $xml-&gt;endElement();//write end element //Return the XML results return $xml-&gt;outputMemory(true); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload