PHP $_Server Variable - What is $_SERVER in PHP



  • $_SERVER is a PHP super global variable which holds information about headers, paths, and script locations.
php-server

Sample Code

<?php
echo $_SERVER['PHP_SELF'];
echo "<br>";
echo $_SERVER['SERVER_NAME'];
echo "<br>";
echo $_SERVER['HTTP_HOST'];
echo "<br>";
echo $_SERVER['HTTP_USER_AGENT'];
echo "<br>";
echo $_SERVER['SCRIPT_NAME'];
?>

Output

php-server

Related Searches to PHP $_Server Variable - What is $_SERVER in PHP