putenv

(PHP 4, PHP 5, PHP 7)

putenvSets the value of an environment variable

Descrierea

putenv ( string $assignment ) : bool

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.

Parametri

assignment

The setting, like "FOO=BAR"

Valorile întoarse

Întoarce valoarea true în cazul succesului sau false în cazul eșecului.

Exemple

Example #1 Setting an environment variable

<?php
putenv
("UNIQID=$uniqid");
?>

A se vedea și

  • getenv() - Gets the value of an environment variable
  • apache_setenv() - Stabilește o variabilă de mediu a unui subprocess Apache