我正在尝试将数组中的名字和姓氏放入页脚,但出现未定义变量错误。这可以在 PDF 的正文中使用,但我不能让它们在页脚中使用。
$FN = $data[0]['data']['FN2'];
$LN = $data[0]['data']['LN2'];
$Name = $FN.' '.$LN;
$this->Cell(40,8,$Name,0,0,'R');
//I also tried this but it didn't work either.I got this error- Using $this when not in object context.
var $Name;
$FN = $data[0]['data']['FN2'];
$LN = $data[0]['data']['LN2'];
$this->Name = $FN.' '.$LN;
$this->Cell(40,8,$this->Name,0,0,'R');