我正在使用 fedexdc 类为订单生成运输标签。问题是当我在我的应用程序页面上运行该函数时,它会从创建的图像中输出所有二进制混乱。我真的只需要将它保存在服务器上(它确实如此)而不是显示在页面上,以便我可以在需要时访问它。这是 fedexdc 类文件中的函数。关于如何做到这一点的任何想法?
function label($label_file=false) {
$this->httpLabel = $this->rHash[$this->image_key];
if ($this->httpLabel = preg_replace('/%([0-9][0-9])/e', "chr(hexdec($1))", $this->httpLabel)) {
$this->debug('separate binary image data');
$this->debug('decoded binary label data');
}
if ($label_file) {
$this->debug('label: trying to write out label to '. $label_file);
$FH = fopen ($label_file, "w+b");
if (!fwrite($FH, $this->httpLabel)) {
$this->setError("Can't write to file $label_file");
return false;
}
fclose($FH);
} else {
return $this->httpLabel;
}
}