PHP替换数据库的换行符

//php 有三种方法来解决 
  
//1、使用str_replace 来替换换行 
$str = str_replace(array("
", "
", "
"), "", $str); 
  
//2、使用正则替换 
$str = preg_replace('//s*/', '', $str); 
  
//3、使用php定义好的变量 (建议使用) 
$str = str_replace(PHP_EOL, '', $str);
原文地址:https://www.cnblogs.com/sunxun/p/4159081.html