这里发生的是我想打印cat1
的值,而不是cat1
字面上正在保存在pdf中。我知道这一定是简单的错误。但帮助将不胜感激。fpdf打印字符串而不是值
<?php
require('WriteHTML.php');
extract($_REQUEST);
$pdf = new PDF_HTML();
$pdf->AliasNbPages();
$pdf->SetAutoPageBreak(true, 15);
$pdf->AddPage();
$pdf->SetFont('Arial', 'B', 14);
$pdf->SetFont('Arial', 'B', 7);
for ($i = 1; $i <= $noofitems; $i++) {
$htmlTable='<TABLE>
<TR>
<TD>Item Category:</TD>
<TD>cat'.$i.'</TD>
<TD>Item Name:</TD>
<TD>item'.$i.'</TD>
</TR>
</TABLE>';
$pdf->WriteHTML2("$htmlTable");
$pdf->SetFont('Arial', 'B', 6);
}
$pdf->Output();
?>
你'$ noofitmes'没有以前那么的循环工作只需一次设定的值。
从你的代码中,你没有将cat1的值设置为字符串,而是将cat和你的concat(。)与'$ i'变量的值设为1,所以你期望的值是多少? –