0

Possible Duplicate:
PHP SimpleXML doesn't preserve line breaks in XML attributes

I have following XML

$xmldatas = '<layer text="name

id"></layer>';

I have parse this XML with

$xml = simplexml_load_string($xmldatas);

But when I checked the $xml, the \n is been replaced with space. I want the new line remains as it is after the xml parsing.

But how can I do that ?

Thanks

Community
  • 1
  • 1
Smit
  • 1,559
  • 17
  • 38

1 Answers1

0

I don't think that xml will accept a new line character in the tag option text. If you are generating the xml maybe you want to do something like this?

$xmldatas = '<layer><text>name
id</text></layer>';
Marco
  • 46
  • 2