You could use the ob_start
function, which starts output buffering and which will result in the header
function not throwing the error message.
You could also use a file (file_put_contents
).
Or like Collin Grady said: If it's just for debugging, ignore the warnings, read the information you need and remove the debug prints again.