I'm developing a php web service which generates some plists so I can use them in my iPhone app. It's everything working perfectly, except for this blank line that appears in the end of the document and makes it unreadable by my app. What could it be? I'm sure all the tags are being properly opened and closed.
Thanks!
After you generate your xml, you could add this one step...
$xml = trim( file_get_contents( YOUR_XML_FILE_PATH ) );
file_put_contents( YOUR_XML_FILE_PATH, $xml );
Hope it helps...
You might have a newline after a closing PHP tag in one of your files:
1. <?php
2. echo $xml;
3. ?>
4.
For this reason, I find it preferable to not close the last ?> in the majority of my files. PHP will automatically close at the end of a file.
1. <?php
2. echo $xml;
3.