There is a <textarea> I get data from it using $('#head_s').val() and send via ajax. The problem is that ajax line break turns into a regular space and I can not distinguish it in php.

  • Are you sure that there is a line break character [s]? - Igor
  • one
    How do you ship? Characters are not just replaced. - user207618
  • Line breaks are there, just the browser does not transfer the string by \ n. - ilyaplot
  • I send using $ .ajax ('save & text =' + $ ('# head_s'). Val ()) ;, in php I replace / n \ n / r \ r with | but does not work - Dmitriy

1 answer 1

Try server-side to use the function nl2br

  • This is a php function and I need js - Dmitry