我正在使用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;
}
}