Ver original$texto = 'mensaje1 and mensaje2 and mensaje3';$patron = '/and/i';$reemplazo = '$1\n';$texto = preg_replace($patron, $reemplazo, $texto);