PHP

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

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);
?>
TutorialsLink Curator

This is an official account managed by the team TutorialsLink Community