wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi



wp_get_server_protocol › WordPress Function

Da4.4.0
Deprecaton/a
wp_get_server_protocol ( Nessun parametro )
Ritorna:
  • (string) The HTTP protocol. Default: HTTP/1.0.
Definito a:
Codex:

Returns the HTTP protocol sent by the server.



Sorgenti

function wp_get_server_protocol() {
	$protocol = isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : '';

	if ( ! in_array( $protocol, array( 'HTTP/1.1', 'HTTP/2', 'HTTP/2.0', 'HTTP/3' ), true ) ) {
		$protocol = 'HTTP/1.0';
	}

	return $protocol;
}