public static function setDataFormat($format) { $format = strtolower(trim($format)); if (in_array($format, self::$_formats)) { self::$_format = $format; return true; } else { throw new ApiException('format 参数错误', ApiError::FORMAT_INVALID); } }