How to print the server name or website name in PHP | PHP program
Feb 23, 2022
PHP,
2618 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);
?>