protected function escape($text) { $text = str_replace("\r\n", "\\n", $text); $text = str_replace("\n", "\\n", $text); return $text; }