Loading, please wait...

A to Z Full Forms and Acronyms

How to print the server name or website name in PHP | PHP program

Feb 23, 2022 PHP, 2569 Views
How to print the server name or website name in PHP | PHP program

How to print the server name or website name in PHP | PHP program

We will use $_SERVER['SERVER_ NAME'] superglobal to get the server or website name and then print that on the webpage.

<?php



$ServerName = $_SERVER['SERVER_NAME'];

printf("Server Name: %s<br>", $ServerName);
?>
A to Z Full Forms and Acronyms