public function getBestResponseType(array $types)
    {
        if (empty($types))
            return "";

        $this->sortTypes($types);
        $type = reset($types);
        return $this->accepts($type) ? current($types) : null;
    }
public function getBestResponseType(array $types)
    {
        if (empty($types))
            return "";

        $this->sortTypes($types);
        $type = reset($types);
        return $this->accepts($type) ? current($types) : null;
    }
public function getBestResponseType ( array $ types ) { if ( empty ( $ types ) ) return "" ; $ this -> sortTypes ( $ types ) ; $ type = reset ( $ types ) ; return $ this -> accepts ( $ type ) ? current ( $ types ) : null ; }
Select the best response type to return from a list of available types.

@param array $types The types that the script is willing to return
@return string The type preferred by the client
Select the best response type to return from a list of available types .