array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'uk', ), 'this' => array ( 0 => 'function.putenv.php', 1 => 'putenv', 2 => 'Sets the value of an environment variable', ), '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' => 'en', 'path' => 'reference/info/functions/putenv.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>
(PHP 4, PHP 5, PHP 7, PHP 8)
putenv — Sets the value of an environment variable
Adds assignment to the server environment. The
environment variable will only exist for the duration of the current
request. At the end of the request the environment is restored to its
original state.
assignment
The setting, like "FOO=BAR"
Приклад #1 Setting an environment variable
<?php
putenv("UNIQID=$uniqid");
?>