# Weird problem with XML

**URL:** <https://forum.kirupa.com/t/weird-problem-with-xml/289163>\
**Category:** programming\
**Created:** [May 27, 2009, 2:26am UTC](https://forum.kirupa.com/t/weird-problem-with-xml/289163 "2009-05-27T02:26:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tartarus](https://avatars.discourse-cdn.com/v4/letter/t/43a26b/32.png) [@Tartarus](https://forum.kirupa.com/u/Tartarus)\
**Post date:** [May 27, 2009, 2:26am UTC](https://forum.kirupa.com/t/weird-problem-with-xml/289163/1 "2009-05-27T02:26:09Z")

</div>

Hi. I’m having a strange problem where I create XML with PHP, but a dot is added at the beggining that I can’t remove and makes the whole XML useless.

Here is my code:

```php
$xml_output = "<?xml version=\"1.0\"?>
";
$xml_output .= "<table>
";

for($x = 0 ; $x < mysql_num_rows($resultID) ; $x++){
    $row = mysql_fetch_assoc($resultID);
    $xml_output .= "	<fish>
";
    $xml_output .= " <email>" . $row['email'] . "</email>
";    
    $xml_output .= " <fishname>" . $row['fishname'] . "</fishname>
";    
    $xml_output .= " <name>" . $row['name'] . "</name>
";
    $xml_output .= " <url>" . $row['url'] . "</url>
";
    $xml_output .= " <type>" . $row['type'] . "</type>
";
    $xml_output .= " <table>" . $row['table'] . "</table>
";
    $xml_output .= "	</fish>
";
}

$xml_output .= "</table>";

echo $xml_output;

```

and here is the result (the dot is in red)

```auto
 [COLOR=Red].[/COLOR]<?xml version="1.0"?>
 <table>
	<fish>
		<email>ivanvendrov@hotmail.com</email>
		<fishname>Pinky</fishname>
		<name>Ivan Vendrov</name>
		<url>www.doom.com</url>
		<type>shark</type>
		<table>0</table>
	</fish>
	<fish>
		<email>ivanvendrov@yahoo.ca</email>
		<fishname>Finky</fishname>
		<name>Ivan Bendrov</name>
		<url>www.caught.com</url>
		<type>dolphin</type>
		<table>0</table>
	</fish>
</table> 

```
