src/request.php
private static function get_primary_mime_type($type) {
	if (strpos($type, ',')) {
		$type = substr($type, 0, strpos($type, ','));
	}
	if (strpos($type, '/')) {
		$type = substr($type, strpos($type, '/')+1);
	}
	if (strpos($type, ';')) {
		$type = substr($type, 0, strpos($type, ';'));
	}
	if (strpos($type, '+')) {
		$type = substr($type, strpos($type, '+')+1);
	}
	
	return $type;
}
private static function get_primary_mime_type($type) {
	if (strpos($type, ',')) {
		$type = substr($type, 0, strpos($type, ','));
	}
	if (strpos($type, '/')) {
		$type = substr($type, strpos($type, '/')+1);
	}
	if (strpos($type, ';')) {
		$type = substr($type, 0, strpos($type, ';'));
	}
	if (strpos($type, '+')) {
		$type = substr($type, strpos($type, '+')+1);
	}
	
	return $type;
}
private static function get_primary_mime_type ( $ type ) { if ( strpos ( $ type , ',' ) ) { $ type = substr ( $ type , 0 , strpos ( $ type , ',' ) ) ; } if ( strpos ( $ type , '/' ) ) { $ type = substr ( $ type , strpos ( $ type , '/' ) + 1 ) ; } if ( strpos ( $ type , ';' ) ) { $ type = substr ( $ type , 0 , strpos ( $ type , ';' ) ) ; } if ( strpos ( $ type , '+' ) ) { $ type = substr ( $ type , strpos ( $ type , '+' ) + 1 ) ; } return $ type ; }
gets a friendly version of a mime type

@param  string $type
@return string the most interesting part of the mime type ..
.. only the first format, and only the most determinating part ..
i.e. 'text/html, ...' returns 'html'
i.e. 'application/json, ...' returns 'json'
gets a friendly version of a mime type