PHP打印机错误

贾斯汀:

大家好,请帮助我解决此代码。我想在php打印机中打印数组的所有值,但仅显示1个。我正在使用php codeigniter框架3.预先感谢您。

在此处输入图像描述输出:数量描述1产品1

$content = "Customer " . $this->uri->segment(2) . "\n"; 
foreach ($orders as $order) { 
    $content = "Qty Description\r" . $order->Quan . " " . 
              " " . " " . $order->Description . "\r"; 
} 
$printer = ("EPSON TM-U220 Receipt"); 
$handler = printer_open($printer); 
if($handler) { 
} 
else { 
    echo "not connected"; 
} 
printer_write($handler, $content); 
printer_close($handler); 
B001ᛦ:

您想连接$content

更改

foreach($orders as $order) {
   $content = ....
}

foreach($orders as $order) {
   $content .= ....   // here-> .= 
}

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章