# Illegal XML characters php

**URL:** <https://forum.kirupa.com/t/illegal-xml-characters-php/244915>\
**Category:** programming\
**Created:** [November 23, 2007, 2:09pm UTC](https://forum.kirupa.com/t/illegal-xml-characters-php/244915 "2007-11-23T14:09:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![agentmca](https://avatars.discourse-cdn.com/v4/letter/a/5daacb/32.png) [@agentmca](https://forum.kirupa.com/u/agentmca)\
**Post date:** [November 23, 2007, 2:09pm UTC](https://forum.kirupa.com/t/illegal-xml-characters-php/244915/1 "2007-11-23T14:09:26Z")

</div>

[FONT=Verdana]Hi Guys, I’m having trouble with illegal special characters when I export XML from PHP. I know it’s a case of replacing for example ‘[/FONT][FONT=Verdana]\<’ with ‘\<’ but I’m having trouble placing it within my code. Cant someone help? Code is below

\<?php require\_once(’…/Connections/connProperty.php’); ?\>  
\<?php[/FONT]  
[FONT=Verdana]  
// Load the XML classes  
require\_once(’…/includes/xml/XML.php’);[/FONT]  
[FONT=Verdana]mysql\_select\_db($database\_connProperty, $connProperty);  
$query\_rsProperty = “SELECT forsale, tagline, p\_address, p\_locality, bullet, p\_desc, footer, CONCAT(img\_path1,p\_img1,img\_path2) AS p\_img1, p\_img2, p\_img3 FROM corryandstewart\_print”;  
$rsProperty = mysql\_query($query\_rsProperty, $connProperty) or die(mysql\_error());  
$row\_rsProperty = mysql\_fetch\_assoc($rsProperty);  
$totalRows\_rsProperty = mysql\_num\_rows($rsProperty);[/FONT]  
[FONT=Verdana]  
// Begin XMLExport rsProperty  
$xmlExport\_rsProperty = new XML\_Export();  
$xmlExport\_rsProperty-\>setRecordset($rsProperty);  
$xmlExport\_rsProperty-\>addColumn(“forsale”, “STRING\_TYPE”, “forsale”);  
$xmlExport\_rsProperty-\>addColumn(“tagline”, “STRING\_TYPE”, “tagline”);  
$xmlExport\_rsProperty-\>addColumn(“p\_address”, “STRING\_TYPE”, “address”);  
$xmlExport\_rsProperty-\>addColumn(“p\_locality”, “STRING\_TYPE”, “locality”);  
$xmlExport\_rsProperty-\>addColumn(“bullet”, “STRING\_TYPE”, “bullet”);  
$xmlExport\_rsProperty-\>addColumn(“p\_desc”, “STRING\_TYPE”, “desc”);  
$xmlExport\_rsProperty-\>addColumn(“footer”, “STRING\_TYPE”, “footer”);  
$xmlExport\_rsProperty-\>addColumn(“p\_img1”, “STRING\_TYPE”, “img1”);  
$xmlExport\_rsProperty-\>addColumn(“p\_img2”, “STRING\_TYPE”, “img2”);  
$xmlExport\_rsProperty-\>addColumn(“p\_img3”, “STRING\_TYPE”, “img3”);  
$xmlExport\_rsProperty-\>setFilename(“property.xml”);  
$xmlExport\_rsProperty-\>setMaxRecords(“8”);  
$xmlExport\_rsProperty-\>setDBEncoding(“UTF-8”);  
$xmlExport\_rsProperty-\>setXMLEncoding(“UTF-8”);  
$xmlExport\_rsProperty-\>setXMLFormat(“NODES”);  
$xmlExport\_rsProperty-\>Execute(“VALUE”, “1”);  
// End XMLExport rsProperty  
?\>[/FONT][FONT=Verdana][/FONT]
