Not sure it would work, because I havent tried it, but I think the only way would be with Javascript: open a new window to run your PHP script, immediately hide it, and then in the "body onload" event, print the window contents (self.print()), and then unload.