PHP XMLAPI: Formatting fetchautoresponder output
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:
Thank you. :)
$xml_object = simplexml_load_string($cpResponse);
foreach($xml_object->data as $key => $value)
{
echo "sender: ".$value->from."
";
echo "subject: ".$value->subject."
";
echo "contents: ".$value->body."
";
}Thank you. :)
-
Although this may not be the ultimate solution, I've found a workaround. The XML string could either be displayed within 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
tags, that would be great. Thank you. :)0
Please sign in to leave a comment.
Comments
1 comment