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

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -