The most elegant solution is encoding with linux, not windows, because it's simple: linux uses \ n for the string, windows use \ r \ n
most editors that are more advanced than notepad support converting a file from windows to linux-style. just browse their respective menus.
and provide a solution written in PHP:
<?php $input = file_get_contents("old.php"); $data = str_replace("\r\n", "\n", $input); file_put_contents("new.php");
your replacement probably didn't work, because most regular editors use backslashes just like backslashes, and don't interpret \ n as an escape sequence for a newline, but just like backslashes and n.
source share