public static function valid_data($str, $use_enc = null) { $enc = self::$hab_enc; if ($use_enc !== null) { $enc = $use_enc; } if (self::$use_library == self::USE_MBSTRING) { return \mb_check_encoding($str, $enc); } return true; }