PHP function getenv Use an example to introduce _php tutorial

Source: Internet
Author: User
share the PHP function getenv Use instance, the GETENV function is mainly used to get the value of an environment variable, the common PHP probe program is to use the getenv function.

Getenv (PHP 4, PHP 5)
Getenv-gets the value of an environment variable
Function Description: www.jbxue.com
String getenv (String $varname)

Gets the value of an environment variable.
With Phpinfo () you can see a list of all the environment variables.
Parameter description:
$varname variable name.
function return value:
Returns the value of the environment variable varname and returns FALSE if the environment variable varname does not exist.
Function Application Example:

 
  PHP//  getenv () Use example $ipgetenv(' remote_addr '); // or simply use global variables ($_server or $_env) $ip $_server [' REMOTE_ADDR '];? >

Through Phpinfo can see the entire PHP environment configuration information, then want to get one of the variable information to do?

Get the following information:

PHP Code:

Echo getenv (' UserProfile '); // C:\Windows\system32\config\systemprofile

http://www.bkjia.com/PHPjc/768445.html www.bkjia.com true http://www.bkjia.com/PHPjc/768445.html techarticle share the PHP function getenv Use instance, the GETENV function is mainly used to get the value of an environment variable, the common PHP probe program is to use the getenv function. Getenv (PHP 4, PHP 5)//getenv get ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.