Page 1 of 1

fpdf problems with commas and/or apostrophes (RESOLVED!)

Posted: Thu Jan 06, 2011 9:02 am
by DelPazzo
Hi,

I'm setting up an fpdf script where I use lots of variables. Some contain commas (,) and apostrophes (') when using these strings in the command cell() I get an unexpected t_string error.
I'm not sure but I think it's the apostrophe that triggers the error.

How can I bypass that?

Examples for such commands:

Code: Select all

//example:
$pdf->Cell(0,0,'69, Route d'Esch');

Re: fpdf problems with commas and/or apostrophes

Posted: Thu Jan 06, 2011 10:37 am
by Jade
I've never had problems with commas before but you have to escape the apostrophes:

Code: Select all

$pdf->Cell(0,0,'69, Route d\'Esch');

Re: fpdf problems with commas and/or apostrophes

Posted: Thu Jan 06, 2011 12:46 pm
by DelPazzo
thx that helped. ;)