Ya.
All PHP does in it's usual form is send out data via the Apache Webserver. PHP can also run as it's own daemon process outside of the Apache Environment.
The output you send out via PHP is up to you.
By no means does it have to be HTML.
PHP can send out anything you feed it such as binary files or other forms of text like XML or plain text.
I've built web spiders with PHP, and those output nothing other than HTTP_REQUEST_HEADERS.
I've also built socket daemons that let you connect and chat via a ssh/telnet commandline or through a custom interface on the desktop and/or browser.
So there you have it. Just because the most common use for PHP is HTML page generation doesn't mean that's all it can be used for. So go ahead and get creative with it.