you can use `preg_split('/\R/', $string)` to split around anything that looks like a newline