Quantcast
Channel: How do I make PHP display new lines from an XML file? - Stack Overflow
Viewing all articles
Browse latest Browse all 3

How do I make PHP display new lines from an XML file?

$
0
0

I use simplexml_load_file to open a soap envelope. When I get to one of the elements of the body, which contains plain text with new lines, and I want to display it, it's displayed without the new lines.

SOAP ENVELOPE extract:

[...]    <Note>root@podio1:~# Aug 10 12:18:20 podio1 genunix: NOTICE: clcomm: Path podio1:nge1 - podio2:nge1 being drainedAug 10 12:18:20 podio1 genunix: NOTICE: clcomm: Path podio1:e1000g1 - podio2:e1000g1 being drainedAug 10 12:18:20 podio1 genunix: NOTICE: CMM: Node podio2 (nodeid = 2) is down.Aug 10 12:18:20 podio1 genunix: NOTICE: CMM: Cluster members: podio1 podio3.Aug 10 12:18:20 podio1 in.routed[925]: 8056 bytes of routing message left overAug 10 12:18:21 podio1 genunix: NOTICE: CMM: node reconfiguration #3 completed.</Note>[...]

and when I echo the note:

[...]$comment = $Note->Comment;echo $comment;[...]

this is what I get on my PHP Page:

root@podio1:~# Aug 10 12:18:20 podio1 genunix: NOTICE: clcomm: Path podio1:nge1 - podio2:nge1 being drained Aug 10 12:18:20 podio1 genunix: NOTICE: clcomm: Path podio1:e1000g1 - podio2:e1000g1 being drained Aug 10 12:18:20 podio1 genunix: NOTICE: CMM: Node podio2 (nodeid = 2) is down. Aug 10 12:18:20 podio1 genunix: NOTICE: CMM: Cluster members: podio1 podio3. Aug 10 12:18:20 podio1 in.routed[925]: 8056 bytes of routing message left over Aug 10 12:18:21 podio1 genunix: NOTICE: CMM: node reconfiguration #3 completed.

Does anybody know what I can do to be able to display the new lines? Each line ends with [CR][LF] in the XML file.

Thanks in advance,

Cristina


Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>