You do not want to use Regex for a simple replacement like this. Regular string replacement functions are usually much faster. To break a line, you can use a constant that supports the OSPHP_EOL , for example
str_replace(PHP_EOL, ', ', $someString);
Windows \r\n. Mac \r \n.