3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "1|John|Smith|company name\r\naddress\r\nwhat they did\r\n2|Amy|Doe|company name"; $new = joint(explode("\r\n",$str)); echo $new;

preferences:
44.69 ms | 402 KiB | 5 Q