What are the best practices for printing with PHP on a Linux system?

When printing with PHP on a Linux system, it is best practice to use the `exec()` function to call the `lp` command, which is a command-line tool for printing. This allows you to send files to the printer queue and specify printer settings. Make sure to properly sanitize user input to prevent any potential security vulnerabilities.

<?php
$file = "file_to_print.txt";
$printer = "printer_name";
$command = "lp -d $printer $file";
exec($command);
?>