Remove/Replace line breaks


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. function replace_line_breaks($str, $replace = '') {
  2. $chars = array("
  3. ", "\n", "\r", "chr(13)", "\t", "\0", "\x0B");
  4. return str_replace($chars, $replace, $str);
  5. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.