I'm assuming your script works like most PHP, and produces a web page to be viewed in a browser.
In that case actual PHP code won't help, because the printing is done at the client side (ie the browser). What you would need to do is include a small amount of Javascript in your HTML output.
Something like this....
Code:
<script language="javascript">
<!--
window.print();
// -->
</script>
Putting that script into your page (at the end of the HTML) will cause the browser to pop up it's print dialog immediately once the page is loaded.
Hope that helps