PHP导出csv文件避免错位换行的方法
$title = rtrim($row['detail']);//函数移除字符串右侧的空白字符或其他预定义字符
$title = str_replace(",", ",", $row['detail']);
$title = str_replace("\n", "", $row['detail']);
$title = str_replace("\r\n", "", $row['detail']);
$title=strip_tags($title);//删除HTML标记;或者使用像htmlspecialchars()这样的库来编码HTML标记
$title='"'.$title.'"';
$row['detail']=$title;