static function cleanTextArea($string, $cleanHtml = false) { $string = self::mb_trim($string); if (!self::vazio($string)) { if ($cleanHtml) { $string = Strings_UTF8::cleanTextHtml($string); } return self::compactaTexto($string); #$newString = $string; $newString = preg_replace('/[ ]*$/ms', '', $newString); $newString = preg_replace('/(<br \\/>|<br>)\\z/m', '', $newString); $newString = preg_replace('/[\\r\\t]/m', '', $newString); #/[\\n\\r\\t]/ return $newString; } return null; }