Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP - FPDF Multicell function does not make a new line

Tags:

html

php

web

fpdf

I'm trying to make a newline inside a multicell. What I've done is:

$pdf->MultiCell(90,10,'test'.'\n'.'test',1,0,'C',1);

According to the manual the multicell should parse the '\n' character and render a newline but it does not (it prints the two byte string '\n' alongside with the actual text)

like image 796
Gianluca Ghettini Avatar asked Dec 25 '22 08:12

Gianluca Ghettini


1 Answers

Try to use "\n" instead of '\n' (or even PHP_EOL predefined constant). Use double quotes.

Related:

  • What is the difference between single-quoted and double-quoted strings in PHP?
  • FPDF multicell alignment not working
like image 82
BlitZ Avatar answered Dec 31 '22 12:12

BlitZ