How to print the server name or website name in PHP | PHP program
Jun 24, 2021
PHP,
346 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);
?>