I am very weak in PHP, but your print command looks plausible.
There might be a chance the \n at the end is not coming through to AI2.
This can only be diagnosed with as direct a copy of the responseContent as possible.
See if you can write the responseContent to a File, and try to grab the file untouched and post (upload) it here.
You might need to use a cross platform tool like DropBox (free) to do this.