Q:

PHP program to print the version of the server software

belongs to collection: PHP Miscellaneous

0

Here, we will use $_SERVER['SERVER_SOFTWARE'] superglobal to get the version of server software and then print that on the webpage.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Program/Source Code:

The source code to print the version of the server software is given below. The given program is compiled and executed successfully.

<?php
//PHP program to print the version 
//of server software.

$ServerSoftware = $_SERVER['SERVER_SOFTWARE'];

printf("Server Software: %s<br>", $ServerSoftware);
?>

Output:

Server Software: Apache/2.2.22 (Win64) PHP/5.3.13

Explanation:

In the above program, we used $_SERVER['SERVER_SOFTWARE'] super global that returns the version of server software, which is assigned to the variable $ServerSoftware. After that, we printed the version of the server software on the webpage.

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

PHP Miscellaneous

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
PHP program to print the server protocol... >>
<< PHP program to print the server name or website na...