我有一个用HTML/PHP编写的订单确认模板。PHP HTML/PHP到PDF文件
如何在这种情况下生成订单确认PDF?
我对如何做到这一点有了一个想法,但不知道如何甚至不知道如何搜索才能实现它,这使得它变得更加困难。
$orders = array(
'900101',
'900102',
'900103',
'900104'
);
foreach ($order as $id) {
// I need to visit oa_template.php?id=$id and save the contents as a PDF,
// but I don't quite understand the simplest method to do so.
//
// contents of oa_template.php?id=$id -> $id.pdf
}
这样做的最简单的方法的任何例子将是伟大的,甚至是一个指向什么功能在PHP等我正在寻找。
在此先感谢。
污垢最简单和可能不会工作,无论如何:'file_put_contents(file_get_contents(“http://example.com/oa_template.php?id=$id”,“$ id.pdf”) );' – 2014-09-24 18:51:06
DomPDF,mPDF,tcPDF ...有很多图书馆可以帮助你做到这一点,如果你只是谷歌 – 2014-09-24 18:54:28