getenv函数 php_Getenv()PHP函数

getenv函数 php

The getenv() function is used to retrieve the value of an environment variable in PHP. The getenv() function returns the value of a specified environment variable. The function follows the syntax getenv (varname). 

getenv()函数用于检索PHP中的环境变量的值。 getenv()函数返回指定环境变量的值。 该函数遵循语法getenv(变量名)。

什么是环境变量 ( What Are Environment Variables )

Environment variables are imported into the environment where the PHP code runs. You probably have more than one deployment of code: a local one for development and one in the cloud, each with different credentials. The environment variables for any two locations are different, so it makes sense not to include them in the main code.

环境变量被导入运行PHP代码的环境中。 您可能有多个代码部署:一个用于开发的本地部署,另一个在云中的部署,每个部署都有不同的凭据。 任何两个位置的环境变量都不相同,因此不要在主代码中包含它们是有意义的。

Getenv()函数的示例 ( Examples of the Getenv() Function )

Below are some examples of environment variables you can use. These code examples retrieve an IP address, the admin's contact information, and the document root.

以下是您可以使用的一些环境变量示例。 这些代码示例检索IP地址,管理员的联系信息和文档根目录。

翻译自: https://www.thoughtco.com/getenv-php-function-2694057

getenv函数 php

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值