1

As you can see I tries to make a very simple XML example with PHP. My problem is that at the end, at </users> I get an XML Parsing Error: not well-formed and I do not understand why since I do not use any special characters or any URLs. Does anyone have any ideas what the problem might be?

parsing error

<?php 
    header('Content-type: text/xml');

    $xml = "<?xml version=\"1.0\" ?>\n";
    $xml .= "<users>\n";
    $xml .= "test\n";
    $xml .="</users>";
    echo $xml;
?>
Nisse Engström
  • 4,738
  • 23
  • 27
  • 42

1 Answers1

1

Problem solved. The solution was posted in this thread: Extra content at the end of the document PHP and XML

In short, I had to open the file with HexEdit and delete some characters.