This question already has an answer here:
I am told that I should use filter_input rather than accessing $_SERVER directly
So I made this simple 2 line of code
echo "filter:input " . filter_input(INPUT_SERVER,'REMOTE_ADDR');
echo "SERVER:" .$_SERVER['REMOTE_ADDR'] ;
Very simple. I expect they both produce the exact same thing.
This is what I got
filter:input SERVER:202.80.212.17
Clearly filter_input(INPUT_SERVER,'REMOTE_ADDR') produces empty string.
Why?
</div>