public static function convertNewlinesToRtfCode($text) { // convert breaks into rtf break $text = str_replace(array("\r\n", "\n", "\r"), '\\line ', $text); return $text; }