-1
I have a code that is giving me problems because it is generating errors in the execution. I need the XML
convert or replace characters but do not know how to do it at runtime. I am trying to do so but unsuccessfully.
<?php
// Receberá todos os dados do XML
$xml = '<?xml version="1.0" encoding="ISO-8859-1"?>';
// Raiz do documento XML
$xml .= '<Imobiliaria>';
// Loop dos valores
for ( $i = 0; $i<count($res)-1; $i++ ) {
$xml .= '<Imovel>';
$xml.="<DESCRICAO>".$res[$i]["Descricao"]."</DESCRICAO>";
$xml.= preg_replace('/&(?!#?[a-z0-9]+;)/', '&', $xml);
$xml.= '</Imovel>';
$xml .= '<Imobiliaria>';
?>
I need to know exactly where, how and variables needed in this code to replace or convert characters and eliminate errors in my generation XML
, this:
$xml.= preg_replace('/&(?!#?[a-z0-9]+;)/', '&', $xml);
Dear Are you creating the XML at hand? If you look at these articles: article 1 Article 2 , and take a look if it will help you build the document.
– Euler01