1

I am trying to create a pdf document using php.

But, I can't get new line in the pdf.

nl2br is not working so I have used

$newadd =  nl2br(str_replace('\r', ' ', $inputSafe['address']));

Now I got the correct output in html as

Naduvilachirayil House,
Anaprampal North P.O,
Thalavady

But in pdf, I am getting only

Naduvilachirayil House,<br>Anaprampal North P.O,<br>Thalavady.
Josh Darnell
  • 11,304
  • 9
  • 38
  • 66
  • Unless you're using an HTML->PDF library, `
    ` means nothing to PDF and will be treated as plaintext.
    – Marc B Nov 21 '11 at 14:55

1 Answers1

0

see if this helps:

$newadd = nl2br(str_replace("\n\r", ' ', $inputSafe['address']));
Al-Punk
  • 3,531
  • 6
  • 38
  • 56