Hola a todos estoy tratando de generar un xml por php pero me reclama por la funcion xmlfix no se donde esta el problema, el error que arroja es el siguiente:
Parse error: parse error, unexpected ')', expecting '&' or T_VARIABLE in /home/direcon/www/html/apps/direcon/proceso.php on line 37
donde linea 37 es donde empieza la funcion xmlfix.
el codigo es el siguiente:
for($x = 0 ; $x < mysql_num_rows($resultID) ; $x++){
$row = mysql_fetch_assoc($resultID);
$xml_output .= "\t<TABLA>\n";
$xml_output .= "\t\t<RUTSTR>" . xmlfix($row['rutstr']) . "</RUTSTR>\n";
$xml_output .= "\t\t<RAZON_SOCIAL>" . xmlfix($row['razon_social']) . "</RAZON_SOCIAL>\n";
$xml_output .= "\t</TABLA>\n";
}
mysql_close($linkID);
$xml_output .= "</ROOT>";
echo $xml_output;
function xmlfix(sIn)
{
$sWorking = trim(sIn);
$sWorking = str_replace("&", "and",$sWorking);
$sWorking = str_replace( "'", "_",$sWorking);
$sWorking = str_replace("á", "a",$sWorking);
$sWorking = str_replace("é", "e",$sWorking);
$sWorking = str_replace("í", "i",$sWorking);
$sWorking = str_replace("ó", "o",$sWorking);
$sWorking = str_replace("ú", "u",$sWorking);
$sWorking = str_replace("Á", "A",$sWorking);
$sWorking = str_replace("É", "E",$sWorking);
$sWorking = str_replace("Í", "I",$sWorking);
$sWorking = str_replace("Ó", "O",$sWorking);
$sWorking = str_replace("Ú", "U",$sWorking);
$sWorking = str_replace("Ñ", "N",$sWorking);
$sWorking = str_replace("ñ", "n",$sWorking);
$sWorking = str_replace("<", "«",$sWorking);
$sWorking = str_replace("\"", """,$sWorking);
$sWorking = str_replace("(", "-",$sWorking);
return $sWorking;
}
alguien sabe porque no funciona???
Saludos y gracias