- var_dump: documentation ( source)
- explode: documentation ( source)
- join: documentation ( source)
<?php
$str = "\r1|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($new);
$str = "\r|John|Smith|company name\r\naddress\r\nwhat they did\r\n|Amy|Doe|company name\r";
$new = join("|",explode("\r\n\t",$str));
var_dump($new);