array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'function.putenv.php', 1 => 'putenv', ), 'up' => array ( 0 => 'ref.info.php', 1 => 'PHP 选项/信息 函数', ), 'prev' => array ( 0 => 'function.phpversion.php', 1 => 'phpversion', ), 'next' => array ( 0 => 'function.restore-include-path.php', 1 => 'restore_include_path', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'zh', 'path' => 'reference/info/functions/putenv.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4, PHP 5, PHP 7, PHP 8)
putenv — 设置环境变量的值
assignment
设置,例如 "FOO=BAR"
示例 #1 设置一个环境变量
<?php
putenv("UNIQID=$uniqid");
?>