Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要让我的 PHP 应用程序使用连接到服务器的打印机打印一些东西。
在 PHP 4.0 中php_printer.dll存在,但已停产。
php_printer.dll
有人对如何使用 PHP 5 完成此操作有任何想法或建议吗?
您可以将输出写入文件,然后使用exec正确的命令(取决于操作系统)打印文件。
exec
例子:
exec('lpr /some/path/to/the/file', $output); // linux exec('print C:\again\a\path', $output); // windows
您可能必须检查 php 用户是否具有打印权限。