What is the use of $_server and $_env?



What is the use of $_server and $_env?..

Answer / Sandeep Kaumr

$_SERVER is a predefined PHP array containing information about the environment in which the script is running, such as HTTP headers, server software, and system settings.n$_ENV, on the other hand, is not a built-in variable in PHP. It can be used to access environment variables, but it's important to note that PHP doesn't have a native way of accessing environment variables like some other languages (e.g., Bash). In most cases, you would use $_SERVER['HTTP_USER_AGENT'] or $_SERVER['REQUEST_METHOD'] for accessing server information.nTo access environment variables, it's recommended to use the getenv() function in PHP.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More PHP Interview Questions

What is session in php why it is use?

1 Answers  


Explain me difference between mysql_connect and mysql_pconnect?

1 Answers  


How can you propagate a session id?

1 Answers  


What is basename php?

1 Answers  


Do you know how to get the ip address of the client?

1 Answers  


Tell me what is the difference between unset() and unlink()?

1 Answers  


What is boolean in php?

1 Answers  


What is $_ get?

1 Answers  


can any please tel me about "Expression Engine"

1 Answers  


How can you declare a constant variable in php?

1 Answers  


Which is better php or wordpress?

1 Answers  


How do I know my xampp version?

1 Answers  


Categories