src/request.php
public static function get_primary_accept() {
	if (empty($_SERVER['HTTP_ACCEPT'])) {
		return '*';
	}
	
	// catch the most common formats
	if (strpos($_SERVER['HTTP_ACCEPT'], 'text/html,') === 0) {
		return 'html';
	}
	if (strpos($_SERVER['HTTP_ACCEPT'], 'application/json,') === 0) {
		return 'json';
	}
	
	// use a generic method
	return self::get_primary_mime_type($_SERVER['HTTP_ACCEPT']);
}
public static function get_primary_accept() {
	if (empty($_SERVER['HTTP_ACCEPT'])) {
		return '*';
	}
	
	// catch the most common formats
	if (strpos($_SERVER['HTTP_ACCEPT'], 'text/html,') === 0) {
		return 'html';
	}
	if (strpos($_SERVER['HTTP_ACCEPT'], 'application/json,') === 0) {
		return 'json';
	}
	
	// use a generic method
	return self::get_primary_mime_type($_SERVER['HTTP_ACCEPT']);
}
public static function get_primary_accept ( ) { if ( empty ( $ _SERVER [ 'HTTP_ACCEPT' ] ) ) { return '*' ; } // catch the most common formats if ( strpos ( $ _SERVER [ 'HTTP_ACCEPT' ] , 'text/html,' ) === 0 ) { return 'html' ; } if ( strpos ( $ _SERVER [ 'HTTP_ACCEPT' ] , 'application/json,' ) === 0 ) { return 'json' ; } // use a generic method return self :: get_primary_mime_type ( $ _SERVER [ 'HTTP_ACCEPT' ] ) ; }
get the primary http accepted output format for the current session

@return string @see ::get_primary_mime_type()
get the primary http accepted output format for the current session