PHP function getenv instance introduction _ PHP Tutorial

Source: Internet
Author: User
The example of using the PHP function getenv. Share the example of using the PHP function getenv. the getenv function is mainly used to obtain the value of an environmental variable. common PHP probe programs use the getenv function. Getenv (PHP4, PHP5) getenv obtains and shares the example of using the PHP function getenv. the getenv function is mainly used to obtain the value of an environment variable. common PHP probe programs use the getenv function.

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

// Obtain the value of an environment variable.
// Use phpinfo () to view the list of all environment variables.
Parameter description:
$ Varname variable name.
Function return value:
// Return the value of the environment variable varname. if the environment variable varname does not exist, FALSE is returned.
Function application example:

 

You can see the configuration information of the entire PHP environment through phpinfo. what if you want to get the information of one of the variables?

Obtain the following information:

Php code:

echo getenv('userprofile');// C:\Windows\system32\config\systemprofile

Bytes. Getenv (PHP 4, PHP 5) // get getenv...

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.