getenv vs. $_ENV

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Anyone know if there's supposed to be any difference between:

$user = getenv ("USER");


$user = $_ENV["USER"];

I'm writing a script to be run by Apple's Installer, and need to know
the logged-in user name. I'm finding that getenv gives me what I need
but $_ENV returns "root" - which is actually what I was expecting since
the script runs with priv. So I was somewhat surprised.


"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted"  --  Bill of Rights 1689

Site Timeline