The source code to print the server protocol is given below. The given program is compiled and executed successfully.
<?php
//PHP program to print the server protocol.
$ServerProtocol = $_SERVER['SERVER_PROTOCOL'];
printf("Server Protocol: %s<br>", $ServerProtocol);
?>
Output:
Server Protocol: HTTP/1.1
Explanation:
In the above program, we used $_SERVER['SERVER_PROTOCOL'] super global that returns the server protocol, which is assigned to the variable $ServerProtocol. After that, we printed the server protocol on the webpage.
Program/Source Code:
The source code to print the server protocol is given below. The given program is compiled and executed successfully.
Output:
Explanation:
In the above program, we used $_SERVER['SERVER_PROTOCOL'] super global that returns the server protocol, which is assigned to the variable $ServerProtocol. After that, we printed the server protocol on the webpage.
need an explanation for this answer? contact us directly to get an explanation for this answer