php - How can you get array data in the footer of fpdf -
i'm trying first , last name array footer i'm getting undefined variable error. work in body of pdf cant them work in footer.
$fn = $data[0]['data']['fn2']; $ln = $data[0]['data']['ln2']; $name = $fn.' '.$ln; $this->cell(40,8,$name,0,0,'r'); //i tried didn't work either.i got 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');
if
$data
happens empty,
$fn
and
$ln
will undefined, causing
$name
to undefined (or ' ') can't guarantee set.
use isset make sure it's set, check if matches empty string or not.
Comments
Post a Comment