I have been having issues with a newline appearing in my browser output with Codeigniter. What happens is I am outputting JSON data, but there is a newline character before any of the JSON data, and it is messing stuff up.
Likely you have some whitespace at the end of one of your PHP files. It is a pretty common problem if you use the closing tag ?>.
You'll want to search your code files and look for a ?> with a newline character after it. Anything after a closing tag gets output to the browser.
As a habit, I don't use closing tags in code files for this reason, as they are not required by the PHP interpreter. Some coding standards recommend this as well. I only use them in template files where there is additional output between/after the PHP code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With