0

Hello everyone I am trying to create a XML file as a string in php so then I can curl it up to our system for processing.

How come I can't just do this?

$XML = ' <?xml version="1.0" encoding="UTF-8" standalone="yes"?>

All of the php code below seems to not want to be picked up anymore after this.

Why does this happen since the entire string is surrounded by ' ' ?

If there is a way around this please let me know.

user1863457
  • 131
  • 2
  • 11

1 Answers1

1

Use the heredoc syntax :

<?php
$str = <<<XML
<?xml version="1.0" encoding...
<partlist>
...
</babelpart>
XML;
Sony
  • 1,773
  • 3
  • 23
  • 39