public function chooseResponse(array $types)
    {
        if (empty($types))
            return null;

        $this->sortTypes($types);
        $first = reset($types);
        $type = key($types);

        return $this->accepts($type) ? $first : null;
    }
public function chooseResponse(array $types)
    {
        if (empty($types))
            return null;

        $this->sortTypes($types);
        $first = reset($types);
        $type = key($types);

        return $this->accepts($type) ? $first : null;
    }
public function chooseResponse ( array $ types ) { if ( empty ( $ types ) ) return null ; $ this -> sortTypes ( $ types ) ; $ first = reset ( $ types ) ; $ type = key ( $ types ) ; return $ this -> accepts ( $ type ) ? $ first : null ; }
Select the preferred reponse type based on a list of response types.
The response types should be provided in preference of the script, if any.
These are then matched with the accepted response types by the client,
and the most preferred one is selected. If more than one type is equally
desired by the client, the first one is selected.

@param array $types The list of response types offered
@return string The preferred response
@see Wedeto\HTTP\Request::acept
Select the preferred reponse type based on a list of response types . The response types should be provided in preference of the script if any . These are then matched with the accepted response types by the client and the most preferred one is selected . If more than one type is equally desired by the client the first one is selected .