- var_dump: documentation ( source)
- str_replace: documentation ( source)
- explode: documentation ( source)
- join: documentation ( source)
<?php
$str = "\n1|John|Smith|company name\r\naddress\r\nwhat they did\r\n2|Amy|Doe|company name\r";
$new = join("|",explode("\r\n",$str));
var_dump($str);
$newest = str_replace(array("\n","\r"), "", $str);
var_dump($new);