PHP is a server-side scripting language. If you need to control printing, that's going to be handled client side. For example, you can include a button on your page, or an icon of a printer that lauches the printer controls of the user's PC. What you need to do is display the page accordingly so it's layout is printer friendly. You do that by appying the appropriate styles. You can use the @media rule to set the layout printer friendly.
<input type="button" value="Print this page" onclick="window.print()">
As for problems with a dot-matrix printer, those aren't going to be resolved by anything you can do in the browser. The print dialog opened by window.print() is the browser's print dialog the same as if the user chose to print the page themselves. What problems exactly are you encountering?