if (getenv("TERM")=='linux')
{
putenv("UNIQUELL=1");
putenv("TERM='os'");
print getenv("TERM")."<br>";
}

$uni=getenv("UNIQUELL");

if ($uni==1)
{
print "this is first<br>";
putenv("UNIQUELL=2");
} elseif ($uni==2)
{
print "this is second<br>";
putenv("UNIQUELL=3");
}
elseif($uni==3)
{
print "this is third<br>";
putenv("UNIQUELL=1");
}

when I writes the following code first term is 'linux' next I am setting to 'os' them also the condition is going to be true. and
when I sets env from php again if I types in command line it is showing previous value only please help me.
adv thanks

    I think you're confused about how environments work.

    The environment is an inheritable data space.

    If you set an environment variable in a PHP process, the variable will be available to that process and its children.

    But inheritance does not flow from child to parent. You can't set a variable in a PHP script and then have it available to a parent shell (or a shell that has no relationship).

    This is not specific to PHP; it is how all environment variables are handled.

      Write a Reply...