$_SERVER is a built in PHP variable, while getenv() ask the environment (probably Apache/IIS) for values.
The best way to get the IP is;
$ip = (!empty($_SERVER['REMOTE_ADDR'])) ? $_SERVER['REMOTE_ADDR'] : getenv('REMOTE_ADDR');
But I doubt there's any difference between these two variables... Hm.