使用 tcpdf 我有一个错误,但我找不到它
Using tcpdf I have an error but I cant find it
我正在尝试将 html table 转换为 pdf,我正在使用 TCPDF 但是当我执行它时网站显示此错误(解析错误:语法错误,意外的“<”在第 87 行 /home2/ecovomxp/public_html/cotizador/pdf.php 中)有人可以帮我找出错误吗?
$html = '
<table>
<thead>
<tr>
<th>Tecnología</th>
<th>Norma de especificación</th>
<th>Imagen</th>
<th>Marca</th>
<th>Modelo</th>
<th>Descripción</th>
<th>Precio unitario</th>
<th>IVA</th>
<th>Instalación</th>
<th>Costo total</th>
<th>Garantía</th>
<th>Cotizar</th>
</tr>
</thead>
<tbody>';
$i = 0;
foreach($records as $r) {
$html .= '<tr>
<td>'.<?php echo escape($r->tecnologia); ?>.'</td>
<td>'.<?php echo escape($r->normaespecificacion); ?>.'</td>
<td><img src="functions/'.<?php echo escape($r->foto); ?>.'"></td>
<td>'.<?php echo escape($r->marca); ?>.'</td>
<td>'.<?php echo escape($r->modelo); ?>.'</td>
<td>'.<?php echo escape($r->descripcion); ?>.'</td>
<td>$'.<?php echo escape($r->preciounitario); ?>.'</td>
<td>$'.<?php echo escape($r->iva); ?>.'</td>
<td>$'.<?php echo escape($r->instalacion); ?>.'</td>
<td>$'.<?php echo escape($r->totalcosto); ?>.'</td>
<td>'.<?php echo escape($r->garantia); ?>.'</td>
<td><input type="text" value="0" class="imp" size="2" /></td>
</tr>';
<?php
$i = $i+1;
}
?>
$html .= '</tbody>
</table>';
正如所说 Geoffrey Mureithi - 这是一个语法错误 -
$i = 0;
foreach($records as $r) {
$html .= '<tr>
<td>'.escape($r->tecnologia).'</td>
<td>'.escape($r->normaespecificacion).'</td>
<td><img src="functions/'.escape($r->foto).'"></td>
<td>'.escape($r->marca).'</td>
<td>'.escape($r->modelo).'</td>
<td>'.escape($r->descripcion).'</td>
<td>$'.escape($r->preciounitario).'</td>
<td>$'.escape($r->iva).'</td>
<td>$'.escape($r->instalacion).'</td>
<td>$'.escape($r->totalcosto).'</td>
<td>'.escape($r->garantia).'</td>
<td><input type="text" value="0" class="imp" size="2" /></td>
</tr>';
$i = $i+1;
}
我正在尝试将 html table 转换为 pdf,我正在使用 TCPDF 但是当我执行它时网站显示此错误(解析错误:语法错误,意外的“<”在第 87 行 /home2/ecovomxp/public_html/cotizador/pdf.php 中)有人可以帮我找出错误吗?
$html = '
<table>
<thead>
<tr>
<th>Tecnología</th>
<th>Norma de especificación</th>
<th>Imagen</th>
<th>Marca</th>
<th>Modelo</th>
<th>Descripción</th>
<th>Precio unitario</th>
<th>IVA</th>
<th>Instalación</th>
<th>Costo total</th>
<th>Garantía</th>
<th>Cotizar</th>
</tr>
</thead>
<tbody>';
$i = 0;
foreach($records as $r) {
$html .= '<tr>
<td>'.<?php echo escape($r->tecnologia); ?>.'</td>
<td>'.<?php echo escape($r->normaespecificacion); ?>.'</td>
<td><img src="functions/'.<?php echo escape($r->foto); ?>.'"></td>
<td>'.<?php echo escape($r->marca); ?>.'</td>
<td>'.<?php echo escape($r->modelo); ?>.'</td>
<td>'.<?php echo escape($r->descripcion); ?>.'</td>
<td>$'.<?php echo escape($r->preciounitario); ?>.'</td>
<td>$'.<?php echo escape($r->iva); ?>.'</td>
<td>$'.<?php echo escape($r->instalacion); ?>.'</td>
<td>$'.<?php echo escape($r->totalcosto); ?>.'</td>
<td>'.<?php echo escape($r->garantia); ?>.'</td>
<td><input type="text" value="0" class="imp" size="2" /></td>
</tr>';
<?php
$i = $i+1;
}
?>
$html .= '</tbody>
</table>';
正如所说 Geoffrey Mureithi - 这是一个语法错误 -
$i = 0;
foreach($records as $r) {
$html .= '<tr>
<td>'.escape($r->tecnologia).'</td>
<td>'.escape($r->normaespecificacion).'</td>
<td><img src="functions/'.escape($r->foto).'"></td>
<td>'.escape($r->marca).'</td>
<td>'.escape($r->modelo).'</td>
<td>'.escape($r->descripcion).'</td>
<td>$'.escape($r->preciounitario).'</td>
<td>$'.escape($r->iva).'</td>
<td>$'.escape($r->instalacion).'</td>
<td>$'.escape($r->totalcosto).'</td>
<td>'.escape($r->garantia).'</td>
<td><input type="text" value="0" class="imp" size="2" /></td>
</tr>';
$i = $i+1;
}