PHP XMLAPI: Formatting fetchautoresponder output

iSofia

Member
Jun 3, 2014
14
0
1
cPanel Access Level
Website Owner
Hello everyone. Is there any way to format the BODY string returned by the fetchautoresponder function? It is set to return XML format ($xmlapi->set_output("xml")) but the output seems to disregard all line breaks and displays the entire body in a single line. This is the extraction code:

Code:
$xml_object = simplexml_load_string($cpResponse); 
foreach($xml_object->data as $key => $value) 
{ 
  echo "sender: ".$value->from."<br>";
  echo "subject: ".$value->subject."<br>";
  echo "contents: ".$value->body."<br>";
}
Thank you. :)
 

iSofia

Member
Jun 3, 2014
14
0
1
cPanel Access Level
Website Owner
Although this may not be the ultimate solution, I've found a workaround. The XML string could either be displayed within <pre> tags, or formatted with the {whitespace: pre-wrap} style. The string would then be displayed with the line breaks.

If anyone knows of a way to re-format the string, and replace these line breaks with HTML <br> tags, that would be great.

Thank you. :)