1

When I add text new line in textarea It displays "rn" while printing the text in tcpdf

For eg i have entered a text in textarea has

1.C++

2.java

While displaying the output it displays as C++rnJava How to remove rn from the text here is the code

    $address= mysql_real_escape_string($_REQUEST["address"]);
    <tr>            
    <td width="30%"></td>
    <td width="70%" style="padding-left:500px; font-size:13px; font-weight:bold;">';

   $html .= stripslashes(str_replace(array("\r","\n"),"", $address));
   $html .= '</td>

How can I remove \r\n from printing

user3286350
  • 89
  • 2
  • 3
  • 12
  • Use [`PHP_EOL`](http://stackoverflow.com/questions/128560/when-do-i-use-the-php-constant-php-eol) instead of `\r\n`. Although not an answer, more of a workaround. – Andrei Jun 08 '15 at 09:33

1 Answers1

0

You should escape slashes and, i think, replace with space to don't make as one word

$html .= stripslashes(str_replace(array("\\r","\\n")," ", $address));
splash58
  • 26,043
  • 3
  • 22
  • 34