troubleshooting Question

Adding a line break in PHP feed output

Avatar of Adam Jones
Adam Jones asked on
PHPHTMLHTTP ProtocolXMLWeb Development
3 Comments1 Solution168 ViewsLast Modified:

I am trying to edit a feed that is created for my blog extension. I want to place a line break after each tag (there is another problem with the feed and bugs are hard to find when it is all on one line) but I cannot get it to work. I have tried /n but this just outputs /n.

It is not echo so I am not sure this is correct to use. Here is the code

            $output  = '<?xml version="1.0" encoding="UTF-8" ?>';
            $output .= '<rss version="2.0" xmlns:atom="">';

I have tried

            $output  = '<?xml version="1.0" encoding="UTF-8" ?> /n';
            $output .= '<rss version="2.0" xmlns:atom=""> /n';

this just outputs

<?xml version="1.0" encoding="UTF-8" ?>/n<rss version="2.0" xmlns:atom=""> /n

I have also tried

            $output  = '<?xml version="1.0" encoding="UTF-8" ?>';
			$output  = "\n";
            $output .= '<rss version="2.0" xmlns:atom="">';
			$output  = "\n";

This makes these lines disappear and replaced with a single line break.

Can someone please give me some advice?

Many Thanks

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros